I almost exclusively use blink to connect to a remote machine where I am running a terminal multiplexer. Having the ability to disable vertical scrolling would be really helpful in avoiding the unintended scrolling that happens when I want to use the mouse reporting of clicks that blink supports via tapping.
I think this feature would be a helpful addition.
Hi @nanzhong,
What terminal multiplexer do you use? tmux or screen?
I use tmux, but assume that this would be helpful for both?
I know tmux better :), tmux sending special escape sequence that terminal supports mouse events.
The main idea is to disable scroll in blink if terminal reported mouse events support. Not sure if it breaks some other apps. Will look on that.
Or even better - forward scroll events directly to tmux
I'd much prefer disabling scrolling to forwarding forwarding scroll events to tmux.
I feel forwarding scroll events seems like the “expected” behaviour in terms of mouse event reporting.
@goerz how do you feel about forwarding scroll events by default with a configuration option to disable scrolling entirely?
I’m suggesting this without much knowledge of the underlynig implementation in blink, @yury would know better what is feasible.
@nanzhong That sounds very good! In any case, I don't feel extremely strongly about any of this, but having an option to completely disable scrolling seems like a pretty good idea. When scrolling is not deactivated, it should behave like on the Desktop. I think both tmux and e.g. vim have option for whether they should handle mouse/scrolling events, or whether the terminal emulator should handle them.
Yes, please for forwarding scrolling events, at least optionally!
Since like @yury I usually use tmux, hterm scrollback is basically useless—tmux handles its own scrollback buffer and prevents scrolled-off lines from entering the hterm scrollback buffer, so you swipe down and just get a blank screen.
I assume you guys have played with Termux for Android — if you haven't, you really should since it's the most featureful terminal emulator on Android (though it's actually also an entire sandboxed Linux environment, since Android allows that) and uses hterm by default. Its featureset is a strict superset of Blink's—its CLI is an actual Linux environment. (But it can do this easily because Android is Linux, too.)
The Termux devs have thought through the correct behaviors for this very well, I think—with a default Linux configuration and unmodified xterm-aware programs, editors like emacs and vim just "do the right thing" in turning tapping into mouse events and swiping into scroll wheel events (or, actually, repetitive button 4 and button 5 events, as is hterm standard). In particular, the way it decides how many button 4/5 events to send based on how much and how quickly you swipe works well.
(If y'all don't have access to Android devices and are curious how some behavior works, just ask me (with a mention, please, so I get notified, or by mentioning me @Trey#6396 on the Discord) and I'll try it for you.)
Summarizing from discussion in Discord with @yury for later reference:
Termux's handling of swipes in the view can be found at this line.
It uses pseudo-mouse buttons 4 and 5 (which it has as constants TerminalEmulator.MOUSE_WHEELUP_BUTTON and TerminalEmulator.MOUSE_WHEELDOWN_BUTTON. As discussed in the hterm docs,
No release events are generated.
Note, also, that in the following else if, it may fall back to arrow keys instead of buttons 4 and 5. This is discussed as the "Alternate Scroll Mode" in the hterm docs here. (For left and right scroll, this alternate scroll mode is the only way to do it, since there are no VT, xterm or ANSI control codes for horizontal scroll "wheels" — up and down are encoded as buttons 4 and 5, but no provision is made for left and right "buttons".)
We released Blink v13.4. It detects mosh/vim/tmux/emacs and stops scroll in favor of mouse wheel.
Closing this issue. Feel free to reopen if needed.
Most helpful comment
Or even better - forward scroll events directly to tmux