Open Canop opened 6 months ago
Related: https://github.com/crossterm-rs/crossterm/issues/401 (bacon uses crossterm for event detection)
fwiw this works around the issue:
bind-key -n WheelUpPane {
if-shell -F '#{mouse_any_flag}' {
send-keys -M
} {
if-shell -F '#{alternate_on}' {
send-keys Up
} {
copy-mode -e
}
}
}
bind-key -n WheelDownPane {
if-shell -F '#{mouse_any_flag}' {
send-keys -M
} {
send-keys Down
}
}
(see also https://github.com/tmux/tmux/issues/3705)
you can duplicate send-keys
more times to increase the scroll speed.
note that all of this only has an effect if set mouse on
is enabled; otherwise all mouse events are passed through unchanged.
strangely scrolling works fine in vim and helix. i wonder if crossterm isn't telling the terminal emulator it can accept mouse events (mouse_any_flag
). i notice https://github.com/Canop/bacon/commit/ead2e058f0b71b88993716c5e3db760e3f7a7cc9 only enables mouse events on windows - do you know why that was done?
ok yes - if i uncomment those cfgs, mouse scrolling works fine in tmux. the problem from https://github.com/Canop/bacon/issues/191 also appears; i suspect it is not actually platform specific and bacon needs to set some config that tells the terminal emulator to handle text selection itself.
ok, i think i have figured out what's going on.
there are two independent bugs here, excluding anything bacon does.
tput smcup
, all of which worked correctly (translated mouse scroll events to up arrows):
i suspect @Adham-A has some broken environment.
given all that, my suggestion is to revert #156, tell tmux users to use the workaround i posted above, and have Adham debug their environment further - i do not think capturing the mouse is a good tradeoff for bacon since it breaks click+drag for selecting text.
whatever was going on in #153
oh - i think this is a bug in vscode. running tput smcup
in its integrated terminal fails to translate scroll events to up and down keys.
Reported by @willhansen in #153 and confirmed.