-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implementation issue about xterm-addon-serialize #3093
Comments
The rows item could be changed to be
The wrapped line would have its start cut off if it's cut off, just like if the row was trimmed off the scrollback when its max capacity is reached.
You would just replay where it was, even if off screen. The hope is you would be restoring to a terminal of the same size, if not the terminal would be changed and so would it's backing pty. This depends on how the embedder implements this. For VS Code, the plan is for a node target xterm.js #2749 to run where ever the node-pty connection is, this would allow us to respond to resize events and serialize only when we need to restore the terminal, so we should have the right size. |
A few more issue. You probably can't unwrap a line that contain CJK correctlyThe string "12345\x1b[1C中文" and "12345中文" produce exact the same layout on 6 width terminal
Thus it is not possible to decide what it original is without knowing where the wrap start. Some terminal state is not available in public apiThing like
|
It is one of the pieces planned to be used to make microsoft/vscode#20013 happen though, but just expect it not to be the super polished atm. |
Fixes xtermjs#3093 Co-authored-by: Megan Rogge <merogge@microsoft.com>
Pushed a change to call out deserializing into terminals of the same size, then resizing after. |
Details
Steps to reproduce
I took a try on implement the todo items in xterm-addon-serialize
And I find a few issue.
(This issue may better be classified a question. But it seems it is weird to ask this is SO as this is not a usage question.)
The rows option
It looks like you can have a
rows
option smaller thanTerminal.rows
But I find the cursor position restoration will be pointless if you set it like that.
That said, you have a 6 * 3 terminal, the cursor is on line 1, text in line 2
And you serialize with
rows
1, and you restore it.You now get one line
123
.But where should you place the cursor? The cursor position(on the top of 123) is out of screen now.
The
rows
interface with theisWrapped
If the isWrapped is considered in serialization (concat the next line to first one if they are the same line that got wrapped).
2
line or1
line?rows
option?The coordinate of cursor.
How should the cursor position restored?
If you write the result into
different sized terminal
.The cursor position may looks pointless in one of the way (depends on usage).
move 1 row down, move 1 col right from the last word in the result.
move to screen postion 4, 8.
The text was updated successfully, but these errors were encountered: