-
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
Keep slave program in sync with terminal #146
Conversation
While this does seem to work, and is quite snappy when sending Consider this command with this change:
And without the change:
Perhaps this could be hooked up somehow to |
Ah yes your 30fps refresh patch will have no effect with all those xon/xoffs, since they will stop the backend with every websocket transfer. Although the stops bind any keyboard action to the next websocket action (therefore feeling snappy and in sync) it is not suitable - the average websocket transfer buffer is about 1k to 3k even for output heavy tasks, that means the backend gets stopped every few thousand bytes. Bummer. I created a new branch with a different approach: https://github.com/jerch/xterm.js/tree/flowcontrol_buffer Regarding the xon/xoff at refresh time: |
Sorry about the delay to get back on this, but finally I got my input. I am not quite fond of the idea of synchronizing the back-end with the front-end. IMO the best option is optimizing rendering as much as possible and maybe offering this feature as an add-on or a flag ( Also it would be great if you could provide us with a PR which swaps |
This would need an almost full rewrite of the |
Another thing we could do would be opening a GitHub issue, proposing a refactoring of the Do you think you could do that (creating a GitHub issue)? |
Sure - feel free to add more ideas and discuss it here #150 |
Awesome, thanks! |
Gonna close the PR since it is obsolete atm... |
Since I got no anwser to #134 (comment) here is a PR addressing the out of sync problem of the slave program and the terminal emulator.
The problem boils down to the nonblocking websocket handling, which cant propagate back the "uhmm, I'm still busy, please wait" of the terminal emulator and buffers more and more bytes. In the result the emulator lacks far behind in data processing. Thus a long running output heavy task seems not to be interruptable (which is not the case, it is just the terminal emulator, which has to get through the big amount of data to the point where the interrupt happened).
This PR uses XON/XOFF flow control to keep the backend and frontend in sync.
You can test this with any long running output intensive task, e.g.
ls -lR /
Related issues are #134 and microsoft/vscode#7801