本文介绍了iTerm2 –用鼠标滚动更少的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从OSX终端切换到iTerm2,并且似乎失去了一项功能.在Terminal中,由于安装了 MouseTerm 滚动浏览less命令的输出. >.

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 command with my mouse, because I had installed MouseTerm.

但是,当我尝试滚动iTerm2中的less输出时,窗口的滚动条会移动.奇怪的是,滚动与vim一样工作.

However, when I try scrolling less output in iTerm2, the window's scrollbar moves instead.Strangely, scrolling works as expected with vim.

如何在iTerm2中用鼠标滚动less输出?

How can I scroll less output with my mouse in iTerm2?

推荐答案

iTerm2问题现已标记为已修复"-但解决方法是添加一个隐藏选项,因此它不是立即显而易见的如何启用新的AlternateMouseScroll选项.

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

由Filippo Valsorda(补丁作者),一旦安装了iTerm2的夜间版本(在1.0.0.20140629中仍然不存在),只需运行以下命令:

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

重新启动iTerm2,您所有的窗口都会报告滚动事件,作为向上/向下箭头转义键当终端处于备用屏幕"(直接寻址)模式时由less,vim,emacs等程序使用.

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

对于诸如vim和emacs之类的提供附加鼠标支持的应用程序,您仍然需要启用鼠标报告模式,因为此自动模式开关只能启用滚动.

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.

这篇关于iTerm2 –用鼠标滚动更少的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 00:01