如何设置 GNU 屏幕以允许鼠标滚轮在回滚缓冲区中滚动?我尝试用谷歌搜索这个问题,但大多数点击都是关于如何允许屏幕内的应用程序使用滚轮。

有帮助吗?

解决方案

我相信你可以添加这样一行到您的~/.screenrc

termcapinfo xterm* ti@:te@

在哪里“的xterm *”是当前的TERM的水珠匹配。要确认它的工作原理,^ A ^ d从你的屏幕分离,然后screen -d -r重新连接,然后ls几次,并尽量向后滚动。它为我工作。


这是什么魔法?好吧,让我们在手册。

screen(1)表示:

termcapinfo term terminal-tweaks [window-tweaks]
  [..]
  The first argument specifies which terminal(s) should be affected by this
  definition. You can specify multiple terminal names by separating them with
  `|'s. Use `*' to match all terminals and `vt*' to match all terminals that
  begin with "vt".
  [..]
  Some examples:

      termcap xterm*  LP:hs@

  Informs screen that all terminals that begin with `xterm' have firm
  auto-margins that allow the last position on the screen to be updated (LP),
  but they don't really have a status line (no 'hs' -  append  `@'  to turn
  entries off).  Note that we assume `LP' for all terminal names that start
  with "vt", but only if you don't specify a termcap command for that terminal.

termcap(5)

String capabilities
    [..]
    te   End program that uses cursor motion
    ti   Begin program that uses cursor motion

其他提示

在屏幕上,则必须先输入“回滚模式”(或“复制模式”),以能够在回滚缓冲器左右滚动:键组合控制 - ESC 控制 - 控制 - [。然后就可以在历史上使用向上滚动,向下键(或<大骨节病>控制 - <大骨节病> B'/骨节病>,<大骨节病>控制 - <大骨节病>˚F到移动页面)。

在该模式下,鼠标滚轮也应该工作,如果它在其他应用程序。 你结束 “回滚模式” 以 ESC

作为用于滚动回滚缓冲器无需先输入回溯模式,即可能不是不修改画面可能的。我从来没有听说过的一种方式从回溯模式访问回溯缓冲器,开。

这乔恩Z为参照的优秀文章不再可用,但我可以从谷歌的缓存鱼的纯文字版本的它。我在这里的情况下,将其保存谷歌会丢弃,以及在未来。原后通过的MikaelStåldal所以信贷,信用是由于

-

如何使用鼠标滚轮在GNU屏幕

GNU屏幕有回溯支持,但默认情况下,你必须使用笨拙键来使用它。我想能够使用Shift键,上一页,按住Shift和PageDown键鼠标滚轮滚动,就像你可以在xterm的事情。

这是不容易为这个配置屏幕,它涉及与终端仿真器合作。但我终于成功地实现该效果很好的解决方案。添加到您的〜/ .Xresources中的文件(你需要退出该生效):

XTerm*saveLines: 0
XTerm*vt100.translations: #override \n\
  Ctrl <Btn4Down>: string(0x1b) string("[25S") \n\
  Lock Ctrl <Btn4Down>: string(0x1b) string("[25S") \n\
  Lock @Num_Lock Ctrl <Btn4Down>: string(0x1b) string("[25S") \n\
  @Num_Lock Ctrl <Btn4Down>: string(0x1b) string("[25S") \n\
  <Btn4Down>: string(0x1b) string("[5S") \n\
  Ctrl <Btn5Down>: string(0x1b) string("[25T") \n\
  Lock Ctrl <Btn5Down>: string(0x1b) string("[25T") \n\
  Lock @Num_Lock Ctrl <Btn5Down>: string(0x1b) string("[25T") \n\
  @Num_Lock Ctrl <Btn5Down>: string(0x1b) string("[25T") \n\
  <Btn5Down>: string(0x1b) string("[5T") \n\
  Shift <KeyPress> Prior: string(0x1b) string("[25S") \n\
  Shift <KeyPress> Next: string(0x1b) string("[25T") \n

然后将它添加到你的〜/ .screenrc文件:

defscrollback 1000

# Scroll up
bindkey -d "^[[5S" eval copy "stuff 5\025"
bindkey -m "^[[5S" stuff 5\025

# Scroll down
bindkey -d "^[[5T" eval copy "stuff 5\004"
bindkey -m "^[[5T" stuff 5\004

# Scroll up more
bindkey -d "^[[25S" eval copy "stuff \025"
bindkey -m "^[[25S" stuff \025

# Scroll down more
bindkey -d "^[[25T" eval copy "stuff \004"
bindkey -m "^[[25T" stuff \004

这个作品在xterm中。我不知道,如果它在其他终端仿真器。

请注意,这禁用的xterm正常滚动的支持,你将只能使用屏幕时滚动。您可能要启动的xterm这样一直使用的屏幕:

xterm -e screen

有关OS X(Snow Leopard)上,对我以下工作:

http://slaptijack.com/system-administration/ MAC-OS-X-终端和-GNU屏幕-回滚/

简言之,它包括加入以下〜/ .screenrc远程主机(一个你上运行的屏幕)上:

defscrollback 5000
termcapinfo xterm* ti@:te@

和使用滚轮在GNU屏幕内的VIM:

[。的vimrc]

set mouse=a             " hold shift to copy xterm
set ttymouse=xterm2     " necessary for gnu screen & mouse

控制 + 接着 [

终端的标题栏现在应该说复印模式。

现在箭头键和如预期鼠标滚轮应该工作。

要返回到正常按Esc键或按回车键几次。

以下两个Cygwin和腻子为我工作: 编辑.screenrc并添加

terminfo xterm* ti=:te=

设置TERM变量vt100代替xterm的运行屏幕也工作之前。结果 我一直在使用这个很长一段时间,就像一个魅力。

添加到您的.bashrc

# make scrollbar / wheel scrolling work when running screen in gnome-terminal (or other)
if [ "$TERM" = "xterm" ]; then
  export TERM=vt100
fi

-

有关参考,我.screenrc具有此(不需要此AFAIK):

# Extend the vt100 desciption by some sequences.
termcap  vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC

如果答案以上不为你工作,确保你没有的标题 alwayslastline 选项在.screenrc设置。如果你有他们,这是不行的:

termcapinfo xterm* ti@:te@

如果您需要这些信息,你可以尝试在终端的标题设置它(与termcapinfo

使用“Ubuntu 16.04.2 LTS”时的解决方案如下:

A)。更新 $HOME/.screenrc 正如之前的答案所指出的:

termcapinfo xterm* ti@:te@

b).使用“设置”-“首选应用程序”,通过在下拉列表中选择“X 终端”将默认终端更改为 xterm。

一些多余的注释

  • 即使我将Termcapinfo系列更改为“*”而不是“ Xterm*”时,包括安装“ LXTERMINAL”在内的其他终端都不适合我。

  • 通过单击屏幕左上角的菜单按钮,您可以使用右下角的第三个图标获取“设置”对话框。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top