iTerm2 – scroll less output with mouse

前端 未结 6 559
梦谈多话
梦谈多话 2021-01-31 02:43

I just switched from OSX Terminal to iTerm2, and I seem to have lost one piece of functionality. In Terminal, I could scroll through output of the less comm

6条回答
  •  执笔经年
    2021-01-31 03:43

    The iTerm2 issue is now marked as "fixed" - but the fix is to add a hidden option, so it is not immediately obvious how to enable the new AlternateMouseScroll option.

    As Filippo Valsorda (author of the patch) writes, once you install a nightly build (still not present in 1.0.0.20140629) of iTerm2, just run this command:

    $ defaults write com.googlecode.iterm2 AlternateMouseScroll -bool true
    

    restart iTerm2, and all your windows will report scroll events as up/down arrow-key escapes when the terminal is in the "alternate screen" (direct addressing) mode used by programs like less, vim, emacs, etcetera.

    For applications like vim and emacs that provide additional mouse support, you will still want to enable mouse reporting mode, as this automatic mode switch only enables scrolling.

提交回复
热议问题