{"action":"created","issue":{"url":"https://api.github.com/repos/xtermjs/xterm.js/issues/1323","repository_url":"https://api.github.com/repos/xtermjs/xterm.js","labels_url":"https://api.github.com/repos/xtermjs/xterm.js/issues/1323/labels{/name}","comments_url":"https://api.github.com/repos/xtermjs/xterm.js/issues/1323/comments","events_url":"https://api.github.com/repos/xtermjs/xterm.js/issues/1323/events","html_url":"https://github.com/xtermjs/xterm.js/issues/1323","id":304133434,"number":1323,"title":"Theme is lost when running .open() multiple times","user":{"login":"LucianBuzzo","id":15064535,"avatar_url":"https://avatars0.githubusercontent.com/u/15064535?v=4","gravatar_id":"","url":"https://api.github.com/users/LucianBuzzo","html_url":"https://github.com/LucianBuzzo","followers_url":"https://api.github.com/users/LucianBuzzo/followers","following_url":"https://api.github.com/users/LucianBuzzo/following{/other_user}","gists_url":"https://api.github.com/users/LucianBuzzo/gists{/gist_id}","starred_url":"https://api.github.com/users/LucianBuzzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucianBuzzo/subscriptions","organizations_url":"https://api.github.com/users/LucianBuzzo/orgs","repos_url":"https://api.github.com/users/LucianBuzzo/repos","events_url":"https://api.github.com/users/LucianBuzzo/events{/privacy}","received_events_url":"https://api.github.com/users/LucianBuzzo/received_events","type":"User","site_admin":false},"labels":[{"id":560715075,"url":"https://api.github.com/repos/xtermjs/xterm.js/labels/needs%20more%20info","name":"needs more info","color":"e6e6e6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-11T06:03:34Z","updated_at":"2018-03-11T21:10:01Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"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\r\nYou can get around this by setting the theme option again, but its not very intuitive.\r\n\r\n## Details\r\n- Browser and browser version: whatsmybrowser.org/b/YWN4JTB\r\n- OS version: OS X 10.13.3\r\n- xterm.js version: 3.2.0\r\n\r\n### Steps to reproduce\r\n\r\n1. Instantiate a new xterm instance and open it on a DOM element \r\n2. Remove the dom element\r\n3. Open the instance using a new DOM element\r\n"},"comment":{"url":"https://api.github.com/repos/xtermjs/xterm.js/issues/comments/372149470","html_url":"https://github.com/xtermjs/xterm.js/issues/1323#issuecomment-372149470","issue_url":"https://api.github.com/repos/xtermjs/xterm.js/issues/1323","id":372149470,"user":{"login":"LucianBuzzo","id":15064535,"avatar_url":"https://avatars0.githubusercontent.com/u/15064535?v=4","gravatar_id":"","url":"https://api.github.com/users/LucianBuzzo","html_url":"https://github.com/LucianBuzzo","followers_url":"https://api.github.com/users/LucianBuzzo/followers","following_url":"https://api.github.com/users/LucianBuzzo/following{/other_user}","gists_url":"https://api.github.com/users/LucianBuzzo/gists{/gist_id}","starred_url":"https://api.github.com/users/LucianBuzzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucianBuzzo/subscriptions","organizations_url":"https://api.github.com/users/LucianBuzzo/orgs","repos_url":"https://api.github.com/users/LucianBuzzo/repos","events_url":"https://api.github.com/users/LucianBuzzo/events{/privacy}","received_events_url":"https://api.github.com/users/LucianBuzzo/received_events","type":"User","site_admin":false},"created_at":"2018-03-11T21:10:01Z","updated_at":"2018-03-11T21:10:01Z","author_association":"CONTRIBUTOR","body":"@Tyriar I would consider calling `.open()` twice a feature! Its a valuable part of how I'm using xterm.\r\n\r\nOn 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()`.\r\n\r\nThe 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."}}
{"actor":{"display_login":"LucianBuzzo"}}