-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
I am building a tool (in TS) that runs terminal applications for which I want to provide a browser-based live terminal view with support for colors/progress bars and all other terminal features. However, I want to load the history of the terminal view dynamically from the server as the user scrolls up (the terminal application is usually started way before the uses opens the webview und thus has some history).
It seems like xterm.js seems to be a good fit for the terminal view.
However, xterm.js parses the ANSI escape sequences on the client which makes it very hard to dynamically load the history. Ideally, the server only stores the history buffer and not all the ANSI escape sequences that make up the buffer when applied in order.
Is this scenario possible with xterm.js's architecture?
For further clarification:
Just storing all the ANSI escape sequences on the server and sending them all to the (xterm-based) client when the client initially connects is not an option, as there can be arbitrary many ANSI escape sequences that are not relevant for the current view and history anymore. E.g. a spinner or a progress bar.
I also already asked this question on SO but didn't get any answer.