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

Scroll visible area when growing window #1506

Merged
merged 1 commit into from Aug 15, 2018

Conversation

chrisduerr
Copy link
Member

Since Alacritty never had any scrollback history, the behavior when the
window height was increased was to just keep the prompt on the same line
it has been before the resize. However the usual behavior of terminal
emulators is to keep the distance from the prompt to the bottom of the
screen consistent whenever possible.

This fixes this behavior by loading lines from the scrollback buffer
when the window height is increased. This is only done when scrollback
is available, so there are only N lines available, the maximum amount of
lines which will be loaded when growing the height is N. Since the
number of lines available in the alternate screen buffer is 0, it still
behaves the same way it did before this patch.

Different terminal emulators have different behaviors when this is done
in the alt screen buffer, XTerm for example loads history from the
normal screen buffer when growing the height of the window from the
alternate screen buffer. Since this seems wrong (the alt screen is not
supposed to have any scrollback), the behavior of Termite (VTE) has been
chosen instead.

In Termite the alt screen buffer never loads any scrollback history
itself, however when the terminal height is grown while the alternate
screen is active, the normal screen's scrollback history lines are
loaded.

This fixes #1502.

Since Alacritty never had any scrollback history, the behavior when the
window height was increased was to just keep the prompt on the same line
it has been before the resize. However the usual behavior of terminal
emulators is to keep the distance from the prompt to the bottom of the
screen consistent whenever possible.

This fixes this behavior by loading lines from the scrollback buffer
when the window height is increased. This is only done when scrollback
is available, so there are only N lines available, the maximum amount of
lines which will be loaded when growing the height is N. Since the
number of lines available in the alternate screen buffer is 0, it still
behaves the same way it did before this patch.

Different terminal emulators have different behaviors when this is done
in the alt screen buffer, XTerm for example loads history from the
normal screen buffer when growing the height of the window from the
alternate screen buffer. Since this seems wrong (the alt screen is not
supposed to have any scrollback), the behavior of Termite (VTE) has been
chosen instead.

In Termite the alt screen buffer never loads any scrollback history
itself, however when the terminal height is grown while the alternate
screen is active, the normal screen's scrollback history lines are
loaded.

This fixes alacritty#1502.
@jwilm
Copy link
Contributor

jwilm commented Aug 13, 2018

Thanks for implementing this! It was definitely on my wish list; glad we'll have it for launch.

You write the best commit messages, btw.

@chrisduerr chrisduerr merged commit 8e8ecdd into alacritty:scrollback Aug 15, 2018
@chrisduerr chrisduerr mentioned this pull request Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants