question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Theme is lost when running .open() multiple times

See original GitHub issue

If 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

  1. Instantiate a new xterm instance and open it on a DOM element
  2. Remove the dom element
  3. Open the instance using a new DOM element

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
LucianBuzzocommented, Mar 11, 2018

@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.

0reactions
Tyriarcommented, Sep 23, 2019
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found