xterm-addon-serialize ignores cursor visibility #3364
Comments
@cyrus-and Imho the serialize addon does not preserve any terminal state beside the buffer data currently, it simply got not implemented yet. Things that would need some care:
Most of the SM/DECSET related flags can be added at the end of the data stream, e.g. |
Thank you @jerch for the quick reply. I ended up implementing this workaround for the time being: let ansi = serializeAddon.serialize();
const {isCursorHidden} = terminal._core._inputHandler._coreService;
ansi += isCursorHidden ? '\x1b[?25l' : '\x1b[?25h'; |
We accept PRs This seems like a pretty straightforward API to add to support it in the serialize addon: interface IBuffer {
readonly isCursorHidden: boolean;
} |
cyrus-and
added a commit
to cyrus-and/ratty
that referenced
this issue
Jun 11, 2021
This has to be performed manually as xterm-addon-serialize does not take care of that, see: xtermjs/xterm.js#3364
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ANSI codes to hide (
\x1b[?25l
) and show (\x1b[?25h
) the cursor are not retained during the serialization. I understand that this concerns more the current state of the terminal, but since the cursor position is preserved, I find it natural to also save the cursor visibility.If this is a wontfix, is there at least a reliable way to detect the cursor visibility? Other than the undocumented:
Also, are there other instances of this scenario that I should be aware of?
Details
Steps to reproduce
package.json
index.html
npm install
open index.html
The alert shows
"hello"
(hence without any ANSI code) but the cursor in the terminal is hidden.The text was updated successfully, but these errors were encountered: