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

Update xterm to v4 #3830

Merged
merged 32 commits into from
Oct 6, 2019
Merged

Update xterm to v4 #3830

merged 32 commits into from
Oct 6, 2019

Conversation

Stanzilla
Copy link
Collaborator

No description provided.

@Stanzilla
Copy link
Collaborator Author

Stanzilla commented Sep 23, 2019

Can't get it to work atm, setting to WIP. The process launches but just does not show the Hyper window.

@Stanzilla Stanzilla added the WIP label Sep 23, 2019
@Stanzilla
Copy link
Collaborator Author

Stanzilla commented Sep 24, 2019

TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at TermGroup_.bind (bundle.js:1)
    at TermGroup_.renderTerm (bundle.js:1)
    at TermGroup_.render (bundle.js:1)
    at h (bundle.js:1)
    at beginWork (bundle.js:1)
    at d (bundle.js:1)
    at f (bundle.js:1)
    at g (bundle.js:1)
    at m (bundle.js:1)
h @ bundle.js:1

on

class TermGroup_ extends react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent {
        constructor(a, b) {
            super(a, b),
            this.bound = new WeakMap,
            this.termRefs = {},
            this.onTermRef = this.onTermRef.bind(this)
        }
        bind(a, b, c) {
            this.bound.has(a) || this.bound.set(a, {});
            const d = this.bound.get(a);
            return d[c] || (d[c] = a.bind(b, c)),
            d[c]
        }

@LabhanshAgrawal
Copy link
Collaborator

Hi, I tried to do this and I'm able to get the terminal window and the shell, but there are some random characters appearing at the top(when using webgl). You can take a look here

@LabhanshAgrawal
Copy link
Collaborator

LabhanshAgrawal commented Sep 24, 2019

TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at TermGroup_.bind (bundle.js:1)
    at TermGroup_.renderTerm (bundle.js:1)
    at TermGroup_.render (bundle.js:1)
    at h (bundle.js:1)
    at beginWork (bundle.js:1)
    at d (bundle.js:1)
    at f (bundle.js:1)
    at g (bundle.js:1)
    at m (bundle.js:1)
h @ bundle.js:1

on

class TermGroup_ extends react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent {
        constructor(a, b) {
            super(a, b),
            this.bound = new WeakMap,
            this.termRefs = {},
            this.onTermRef = this.onTermRef.bind(this)
        }
        bind(a, b, c) {
            this.bound.has(a) || this.bound.set(a, {});
            const d = this.bound.get(a);
            return d[c] || (d[c] = a.bind(b, c)),
            d[c]
        }

@Stanzilla this is coming because of onURLAbort in term-group.js as it is undefined in props

@Stanzilla
Copy link
Collaborator Author

Stanzilla commented Sep 24, 2019

oh thank you, that's indeed better. Those random characters are the xterm atlas, I think

@Stanzilla
Copy link
Collaborator Author

@LabhanshAgrawal try this

@LabhanshAgrawal
Copy link
Collaborator

Facing problems with yarn install with the changed node-pty version. Also the rendererType TermOption cannot be 'webgl' in the new xterm.

@Stanzilla
Copy link
Collaborator Author

@LabhanshAgrawal why not? it can be if we load the plugin?

@LabhanshAgrawal
Copy link
Collaborator

LabhanshAgrawal commented Sep 24, 2019

That's the error I'm getting. I think since the renderer has been moved to a plugin, it would set the renderer type when loaded.
@Tyriar might be able to clarify better.

@Stanzilla
Copy link
Collaborator Author

Oh I see

@LabhanshAgrawal
Copy link
Collaborator

Removing the rendererType TermOption and reverting the node-pty version is working for me.

@LabhanshAgrawal
Copy link
Collaborator

The random characters at the top are also gone

@Stanzilla
Copy link
Collaborator Author

Yup. pushed your suggestion, looks good!

@LabhanshAgrawal
Copy link
Collaborator

Is there any specific reason for changing the node-pty version? 0.9.0-beta26 is not compiling for me (on mac)

@Stanzilla
Copy link
Collaborator Author

@LabhanshAgrawal yes we need it for the next Electron update. Which node version are you on?

@LabhanshAgrawal
Copy link
Collaborator

my node version is 12.6.0

@Stanzilla
Copy link
Collaborator Author

@GitSquared afaik all the fork did was bundling the webgl addon and enabling it. sadly @juancampa is no longer responding on the hyper project.

@Stanzilla
Copy link
Collaborator Author

@ivanwonder yeah, it's fine in VS code, I tried.

@ivanwonder
Copy link
Contributor

after resize, continue to input and check if it's layout correctly. maybe it's not the problem of xterm. there are no windows on my side

@Tyriar
Copy link
Contributor

Tyriar commented Oct 4, 2019

@ivanwonder haven't seen that, something like it happened in Firefox but we fixed that bug a long time ago. Note VS Code doesn't use the webgl renderer yet so it could be related to that?

@ivanwonder
Copy link
Contributor

20191004-0

@Stanzilla
Copy link
Collaborator Author

My video about the resizing problem was with the canvas renderer btw

@ivanwonder
Copy link
Contributor

@Tyriar it's canvas render. I search the issues and find fixed. but still exist.

@Tyriar
Copy link
Contributor

Tyriar commented Oct 4, 2019

I think this is the line that controls that:

https://github.com/xtermjs/xterm.js/blob/ff790236c1b205469f17a21246141f512d844295/src/browser/renderer/atlas/DynamicCharAtlas.ts#L254

Unless there's a bug in that version of Chrome? 🤷‍♂

@Stanzilla
Copy link
Collaborator Author

I just noticed that resizing is fine for all visible lines but off for the ones currently out of view. See https://dl.dropboxusercontent.com/s/7fcwjxyw0yivl86/2019-10-04_16-16-11.mp4

do we have to call .fit() on scroll events?

@Tyriar
Copy link
Contributor

Tyriar commented Oct 4, 2019

I just noticed that resizing is fine for all visible lines but off for the ones currently out of view.

That's just how winpty/conpty work because they wrap lines before xterm.js gets them. With a native pty they let the terminal emulator wrap them, see microsoft/terminal#405

@Stanzilla
Copy link
Collaborator Author

Hrm, how do we best handle that then or just have to live with it?

@Tyriar
Copy link
Contributor

Tyriar commented Oct 4, 2019

@Stanzilla you just have to live with it, as you have already been doing if you're on Windows. Until the upstream issue is fixed.

@Stanzilla
Copy link
Collaborator Author

meh, okay. I also noticed that resizing duplicates content in this case, looks like this then
image

@ivanwonder
Copy link
Contributor

20191004-0
this is new xterm 4 with chrome 66 in electron
my local chrome version is the latest 77.0.3865.90. 😂

@Tyriar
Copy link
Contributor

Tyriar commented Oct 4, 2019

@ivanwonder oh it's in the demo? I don't see any issues on latest Edge Dev (Chromium 79):

Screen Shot 2019-10-04 at 8 08 18 AM

Might be related to the font?

@ivanwonder
Copy link
Contributor

DejaVu Sans Mono for Powerline the font I use

@LabhanshAgrawal
Copy link
Collaborator

I am not facing any text rendering issues with this pr (using canvas renderer). The issue I had mentioned was on merging xterm4 with electron6 branch (which on itself has rendering issues for me)
The only issue in this pr for me is the initial load resize.
(Note: This is all on mac os, can't say about others)

@Stanzilla
Copy link
Collaborator Author

Yeah I think we have to ignore the various Windows quirks and accept them. I only have Windows so here, so kinda need you guys to judge if we are otherwise ready or not.

@ivanwonder
Copy link
Contributor

It's ok for me. I can live with that.

@GitSquared
Copy link
Contributor

Everything works great for me on Linux, however the "About" pop-up shows the renderer is set to canvas - I'm not sure if that's expected?
Latest Hyper stable release defaults to WebGL instead.

@LabhanshAgrawal
Copy link
Collaborator

@GitSquared WebGL is disabled in this pr because it had some issues. See line 139 in term.js

@GitSquared
Copy link
Contributor

@LabhanshAgrawal Oh OK, got it. I wrote this comment but didn't think it was copied here.

@Stanzilla
Copy link
Collaborator Author

Are we ready to merge then?

@LabhanshAgrawal
Copy link
Collaborator

There is the initial load resize issue, which is small and the fixing of webgl renderer, both can be tracked in new issues. I think it should be ok to merge now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants