Skip to content

Infinite history log on server #2181

@hediet

Description

@hediet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/questionA question on how to use the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions