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

Make scrollback support alternative screen buffer (e.g. tmux history) #1000

Closed
maximbaz opened this issue Jan 6, 2018 · 9 comments · Fixed by #1147
Closed

Make scrollback support alternative screen buffer (e.g. tmux history) #1000

maximbaz opened this issue Jan 6, 2018 · 9 comments · Fixed by #1147

Comments

@maximbaz
Copy link
Contributor

maximbaz commented Jan 6, 2018

UPDATE: I'm not sure, this might or might not be relevant for alternative screen buffers in general, not only for tmux, see #657 (comment).


The initial implementation of scrollback #657 does not support tmux, so when I start tmux and run tree / to generate a lot of output, the alacritty's scrollback will be empty.

Sakura terminal on the other hand supports tmux history, so when you have one pane, the results of scrolling via sakura and via tmux itself are identical. Sakura is based on VTE, so presumably there are other terminals that behave in the same way.

I will be using tmux after scrollback is released, some of its features (like incremental search) and plugins (such as laktak/extrakto) are too important for me to lose, but I would really like to disable mouse support in tmux and enjoy the much smoother and pleasant scrollback provided by alacritty.

Tmux can probably also help handling reflows (window resizes) until this is implemented in alacritty.

@tbodt
Copy link
Contributor

tbodt commented Jan 6, 2018

congrats on issue #1000! 🎉

@maximbaz maximbaz changed the title Make scrollback support tmux history Make scrollback support alternative screen buffer (e.g. tmux history) Jan 11, 2018
@nixpulvis
Copy link
Contributor

This sounds like it'll be tmux specific code. Or is the history buffer something used across programs? Not that we can't have tmux specific code, I'm just trying to understand the issue.

@maximbaz
Copy link
Contributor Author

maximbaz commented Jan 12, 2018

I hope more knowledgeable people will answer here, but when I initially brought this question up on IRC, others were using a more generic term, if I remember correctly it was "alternative scrollback buffer". It also sounded like a not very big deal to add the support for tmux. Then there was this comment, which was later retracted, so in the end I'm personally not sure how much tmux-specific this is.

@tbodt
Copy link
Contributor

tbodt commented Jan 12, 2018

tmux does not work with terminal emulator scrollback, by design. Instead it has its own scrollback, which you access with ctrl-b [ (iirc).

@maximbaz
Copy link
Contributor Author

I used sakura terminal before (vte-based, so others probably behave similarly), and it works perfectly fine with tmux scrollback when there is only one pane. I need tmux not for panes, but for other things, and I would really enjoy the much smoother alacritty's scrollback than the one provided by tmux 🙂

@nixpulvis
Copy link
Contributor

nixpulvis commented Jan 12, 2018

Are you sure it's not just capturing the mouse events and triggering a faux scroll, like vim does?

@maximbaz
Copy link
Contributor Author

Absolutely, it's easy to show in a gif.

Here's how the scroll works when sakura is in control of the scroll (tmux' status bottom panel is gone, behavior with second pane is weird):

sakura-tmux-scrollback

And here's how the scroll works when tmux is in control:

sakura-tmux-faux-scroll

@maximbaz
Copy link
Contributor Author

For completeness, this is how alacritty works when alacritty is in control of scrollback (the output of tree command is not available when I scroll up):

alacritty-tmux-scrollback

I want alacritty to match the behavior with the sakura terminal on the first gif.

This was referenced Mar 9, 2018
@chrisduerr
Copy link
Member

Termite, which is based on a fork of VTE, does not support this.

If I understand http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer correctly, this should not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants