Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade xterm v3.12.0 to v4.10.0 #8260

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

sahil143
Copy link
Contributor

@sahil143 sahil143 commented Mar 1, 2021

Fixes: https://issues.redhat.com/browse/ODC-5547

Analysis / Root cause: To send commands programmatically to the terminal we need feature(addons) from the xterm.js v4.10.0

Solution Description: upgrade xterm version

Screen shots / Gifs for design review: No UI changes

Unit test coverage report:

Test setup:

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Mar 1, 2021
@openshift-ci-robot openshift-ci-robot added component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared labels Mar 1, 2021
}

public dispose(): void {
if (this.terminal && this.terminal.element.classList.contains('fullscreen')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of checking for this.terminal here and below, will it make sense to just have

Suggested change
if (this.terminal && this.terminal.element.classList.contains('fullscreen')) {
if (his.terminal?.element?.classList?.contains('fullscreen')) {

@rohitkrai03
Copy link
Contributor

/assign


XTerminal.applyAddon(fit);
XTerminal.applyAddon(full);
import { XtermAddonFullscreen } from '@console/shared';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need custom implementation of fullscreen addon? Did xterm remove support for their fullscreen addon?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc @sahil143 said they removed this addon. I'm not sure if they replaced or why it was removed though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, seems like they removed fullscreen addon - xtermjs/xterm.js#2065 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fullscreen addon was removed when addon api changed

@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@christoph-jerolimov
Copy link
Member

christoph-jerolimov commented Mar 10, 2021

@sahil143 I found two issues:

a) The small one is the "black gap" on the bottom right corner below the scrollbar:

image

update: This issue already exist on the master branch. Would be cool to fix this anyway. Up to you.

b) It looks like the page resize depends on the full screen height instead of the window height. I have two scrollbars. The one for the terminal is fine but the other one shows a white space below the terminal:

Peek.2021-03-10.09-35.mp4

update: Could reproduce this also on the latest Chrome and Firefox version. This does not happen on master. See comments below.

@christoph-jerolimov
Copy link
Member

/retest

@sahil143
Copy link
Contributor Author

@jerolimov I'm not able to reproduce this on chrome version 89. Which version are you on?
xterm-up

@invincibleJai
Copy link
Member

invincibleJai commented Mar 10, 2021

I was able to reproduce in chrome 88 but then I upgraded to 89 and can't see dual scroll anymore however on firefox I can on 78.8.0esr

@christoph-jerolimov
Copy link
Member

christoph-jerolimov commented Mar 10, 2021

I tested this also on Chrome 88 where this happen. I updated now to Chrome 89 and it works here.

Don't know if we want fix this anyway? As mentioned by Jai it happens also on the latest Firefox ESR version. Hmm?

@sahil143
Copy link
Contributor Author

I tried on Firefox 87 as well not able to reproduce it.

@christoph-jerolimov
Copy link
Member

christoph-jerolimov commented Mar 10, 2021

@sahil143 I can reproduce this also on (latest stable) 86.0. But it does not happen always! It only happens here if I first added some content (many ls -l outputs) to the output and then reduced the window size:

Peek.2021-03-10.12-57.mp4

Here the same issue with (latest) Chrome 89:

Peek.2021-03-10.12-59.mp4

I tested this also again on the master branch and could not reproduce this here.

My problem A with the black border below the scrollable area exists already on the master branch.

Tested with master:

Peek.2021-03-10.13-05.mp4

@sahil143
Copy link
Contributor Author

Took some time but finally figured out the issue. The main issue here is with the xterm-helper-textarea it has a position absolute and top, left calculated. When there is content in the terminal the text area is at the bottom but when the browser is resized, we update the height and width of the container/outerRef div then xterm updates the dimensions using the fit addon to fit into the container/outerRef but the xterm-helper-textarea stays at the bottom and its position doesn't update that's why the scrollbar appears. The issue fixes itself when the user starts to type again in the terminal.

Kapture 2021-03-11 at 21 43 36

cc @jerolimov @invincibleJai

@sahil143
Copy link
Contributor Author

There is already an open issue on xterm.js repo with similar behaviour xtermjs/xterm.js#3065

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already an open issue on xterm.js repo with similar behaviour xtermjs/xterm.js#3065

Would be cool to fix it there and keep this bug in mind. I will create a new issue for this so that we can upgrade the dependency now for your depending work.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 11, 2021
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, jerolimov, sahil143

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit a5ce40a into openshift:master Mar 12, 2021
@spadgett spadgett added this to the v4.8 milestone Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants