Theme is lost when running .open() multiple times
See original GitHub issueIf you call .open()
a second time, the terminal will lose its theme. This is due to the theme option being set to null here https://github.com/xtermjs/xterm.js/blob/3.2.0/src/Terminal.ts#L700
You can get around this by setting the theme option again, but its not very intuitive.
Details
- Browser and browser version: whatsmybrowser.org/b/YWN4JTB
- OS version: OS X 10.13.3
- xterm.js version: 3.2.0
Steps to reproduce
- Instantiate a new xterm instance and open it on a DOM element
- Remove the dom element
- Open the instance using a new DOM element
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Run application multiple times that doesn't usually allow it ...
You can run an application multiple times if you hold down the 'shift' key and click it, IF the developers allow it.
Read more >Opening Word multiple times - Microsoft Community
Every time I go to a file and ask to open a document, Word starts (it opens, the blue box comes up and...
Read more >The event loop - JavaScript - MDN Web Docs - Mozilla
JavaScript has a runtime model based on an event loop, which is responsible for executing the code, collecting and processing events, ...
Read more >How to Fix The ERR_TOO_MANY_REDIRECTS Error - Kinsta
In Safari, it will show as Safari Can't Open the Page (as seen below). Too many redirects occurred trying to open “domain.com.” This...
Read more >Behavior changes: Apps targeting Android 13 or higher
Learn more about how to request permission to access nearby Wi-Fi devices. ... theme behavior, use the setAlgorithmicDarkeningAllowed() method instead.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Tyriar I would consider calling
.open()
twice a feature! Its a valuable part of how I’m using xterm.On https://dashboard.resin.io/ we use xterm.js 2.7.x for our webterminal. On the dashboard you are able to open a webterminal session, navigate away to another page (removing the DOM element) and then come back to the webterminal page (adding a new DOM element) and resume your session where you left off. This functionality still works using xterm 3.2.0, you just need to set the theme again after calling
.open()
.The ability to ‘unattach’ the xterm instance from the DOM and then ‘re-attach’ it at a later date is a really powerful tool. I understand that it’s not a common use case though.
This should get fixed in https://github.com/xtermjs/xterm.js/pull/2435