Skip to content
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

Add VT sequence: DECSCLM - Scrolling Mode #1204

Closed
christianparpart opened this issue Sep 17, 2023 · 3 comments · Fixed by #1212
Closed

Add VT sequence: DECSCLM - Scrolling Mode #1204

christianparpart opened this issue Sep 17, 2023 · 3 comments · Fixed by #1212
Labels
enhancement New feature or request VT: Backend Virtual Terminal Backend (libterminal API)
Milestone

Comments

@christianparpart
Copy link
Member

We currently only implement fast mode, but it might make sense to also implement smooth (slow) mode.
This mode only affects adding new lines at a slow rate, but - in modern age - we could correlate that feature with smooth scrolling (of new lines to be added), see #145.

One open question I am having is how long the linefeed should wait until resuming terminal I/O processing.

How to implement

One design idea I am having in my mind is, to actually suspend processing for N msecs on received linefeeds, if slow scrolling mode is enabled. This should effectively also suspend reading from the TTY to avoid flooding the internal buffers.

References

@christianparpart christianparpart added enhancement New feature or request VT: Backend Virtual Terminal Backend (libterminal API) labels Sep 17, 2023
@christianparpart christianparpart added this to the 0.4.? milestone Sep 17, 2023
@j4james
Copy link

j4james commented Sep 19, 2023

One open question I am having is how long the linefeed should wait until resuming terminal I/O processing.

On the early DEC terminals (VT100, VT220, VT240, and VT340) the smooth scrolling speed was 6 lines per second. The VT340 apparently also had an option in the settings that could adjust the speed (choosing between 3, 6, and 12).

On level 5 terminals (like the VT510, VT520, and VT525) the default smooth scrolling speed was 9 lines per second, but there was also an escape sequence to adjust that to 18 (See DECSSCLS).

I think the choice was largely dictated by the hardware specs. For example, the VT100 had a 60Hz refresh rate with a cell height of 10px, so scrolling one pixel per refresh gives you 60/10 lines per second. For the VT510, you've got 72Hz and a 16px cell height, so scrolling two pixels per refresh gives you 72*2/16 lines per second.

@Yaraslaut
Copy link
Member

Yaraslaut commented Sep 22, 2023

What will happen if I have a stream that contains more lines that I want to have in the history and then enable slow scrolling? as an example find /

Edit:
Oh right, i see that the idea is to to stop I/O, will it work with extensive logging from the process?

@christianparpart
Copy link
Member Author

will it work with extensive logging from the process?

yes, because the terminal I/O thread is slowed down due to the artificially injected delay upon each LF to be executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request VT: Backend Virtual Terminal Backend (libterminal API)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants