mouse wheel scrolling
Hi,
bat doesn't appear to support mouse wheel scrolling out of the box.
I don't know if bat offers some opt-in parameters to enable this, but once is does, these should arguably be enabled by default.
Latest stable bat Homebrew zsh macOS Sequoia
I agree that this should be enabled by default, or at least be able to set it as a default. The way I've figured out how to get it to work is by enabling mouse mode in the pager, like so:
bat --pager="less -R --mouse" your_file.txt
You can also set your PAGER environment variable to include the necessary less options:
export PAGER="less -R --mouse"
After setting this variable, any command that uses the PAGER environment variable, including bat, will automatically use these settings. This could be set in your .zshrc or .bashrc profile so it's always available.
With --pager="less -R --mouse", quitting back to the terminal often dumps junk characters into the next prompt.
In fact, Apple less with -R --mouse has this problem. Curious.
... and with Homebrew (GNU) less. Yikes.
GNU less with -R but no --mouse scrolls somewhat better. Though, like so many other bat configurations, when mouse wheel scrolling is enabled, then the cursor can no longer select any of the text.
You can try with --pager=builtin