-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
The terminal instance cannot be rendered correctly after calling .open()
for the second time.
#4978
Comments
I am not very deep into the browser side of the code, @Tyriar has more insights here. Still I think it is not possible to move an already DOM-attached terminal to another DOM node by calling @Tyriar Do we need an attach/detach cycling for the DOM hooking? It never came to me before, that someone would want to move an existing terminal to another DOM node, so this might be just a wild idea of limited use. Loosely linked or more generalized to this would be support of a copy ctor like |
+1 to this. I have the same use case in our work application which has multiple kinds of terminals in various drawers that can be opened/closed at will. |
Calling If we can get a repro case without React it will be a lot more clear how to action this. |
Here's a little codesandbox (no React). The Open button mounts the terminal instance to the DOM and writes a line. The Replace button removes the DOM and replaces it with a new div. Running Open again results in no line being written. https://codesandbox.io/p/sandbox/fz8kq2?file=%2Fsrc%2Findex.ts demo-xterm-multiple-open.mp4 |
FWIW, my workaround for now has been to register when the terminal mount DOM has been changed and/or removed. If so, I |
Just wanted to mention that |
Can't seem to debug in the code sandbox, but it's likely it's hitting this: xterm.js/src/browser/CoreBrowserTerminal.ts Lines 402 to 409 in 41e8ae3
Maybe |
@Tyriar I have tested locally for my use case, and like you suggested, adding |
I am new to using xtermjs. I am not sure whether the terminal instance can call the
open()
method multiple times. According to the official documentation and #1323, I tried it. When I removed the dom and mounted again, and usedterminal.open()
, xterm did not render after the second open.Details
Steps to reproduce
Reproduce
I'm sorry if there's something wrong with my usage
The text was updated successfully, but these errors were encountered: