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

Consider migrating to xterm.js #41

Open
sabbaka opened this issue Sep 21, 2017 · 5 comments
Open

Consider migrating to xterm.js #41

sabbaka opened this issue Sep 21, 2017 · 5 comments

Comments

@sabbaka
Copy link

sabbaka commented Sep 21, 2017

It might be a good time to switch to xterm.js, which is maintained and updated instead of deprecated term.js.
This might be beneficial for cockpit also.

@sabbaka sabbaka added this to the First release milestone Sep 21, 2017
@spbnick
Copy link
Member

spbnick commented Sep 22, 2017

We need to ask Cockpit team if and how we can do that.

@sabbaka
Copy link
Author

sabbaka commented Nov 2, 2017

We will need to deal with proper building of xterm.js with webpack - they are doing some efforts in this directions - xtermjs/xterm.js#1018
Valuable feature is full screen, which is nice to have also, though I have tested it and it makes full screen only in terms of page, not actual full screen.
Also, this is how xterm.js is looking inside Cockpit, some CSS is broken.
screenshot from 2017-11-02 17-01-02
And this is how mc looks in xterm.js demo, still not very nice.
screenshot from 2017-11-02 17-02-10

This is may be useful also: https://xtermjs.org/docs/api/addons/attach/

@sabbaka
Copy link
Author

sabbaka commented Nov 2, 2017

Okay, so I've moved back to work with term.js for now - and I've made a POC for this feature. It's POC, because I'm changing font-size in very inefficient way with jQuery.css() method, which hangs on playback, but works with step-by-step feature.
For now, I've created a static list with cols amount and font-size, which is working fine - I've tested with different zoom level in Chromium, of course it's not covering all possible variations and that's why I have an idea to create a function to check if width is broken and if it's return smaller font-size value. Example of almost same function is already in term.js source code.
Here are some example of how it's working now:
https://youtu.be/K5g_AdZKRIY
https://youtu.be/DSk-vxSBaEk
https://youtu.be/bRWI9jUdw5M

@sabbaka
Copy link
Author

sabbaka commented Nov 2, 2017

Also, just a general notice - I really want to add full-screen feature ( like a real full screen on YouTube for example ) + I want to add buttons for adjusting font-size, maybe even with broken lines at the end, just to give this kind of flexibility for user ( like we can have in open source software in general as an example ) - or we can just hide part of terminal if it's going to break lines.

@sabbaka
Copy link
Author

sabbaka commented Nov 2, 2017

As for resizing of terminal div on page - it's right now under a question for me - if we should do it at all, but it will definitely possible to make such after I'll create this self-validation function for line width and font size correlation check.

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

No branches or pull requests

2 participants