使用 Shift-PageUp 在 gnu 屏幕中向上翻页

使用 Shift-PageUp 在 gnu 屏幕中向上翻页

在 Linux 终端中,按键序列 Shift-PageUp 通常可用于向上滚动。

然而,当 ssh 到特定机器时,这个按键序列似乎在 gnu 屏幕中不起作用。

我有两个问题。 1)这个按键序列在哪里定义的? 2) 我可以在屏幕设置中更改哪些内容以始终允许此操作?

这与 termcap 条目有关系吗?

我目前使用三台机器。其中两个将在按下 Shift-PageUp 时向上滚动缓冲区。一台机器根本不会响应按键。

工作机器:

  • 森托斯 6.5
  • 森托斯 5.9

不工作的机器:

  • 森托斯 5.9

这是我在所有三台机器上使用的 .screenrc

termcapinfo xterm|xterms|xs|rxvt ti@:te@

term screen-256color

hardstatus on
hardstatus alwayslastline
hardstatus string "%{= wb}%-w%{.yb}%n %t%{-}%+w %=%{b r} %H %{..b}[%l] %{..K}%C%a "

startup_message off

# turn off visual bell
vbell off

# Autodetach session on hangup instead of terminating screen completely
autodetach on 

# give more scroll back
defscrollback 20000

# turn on alternate screen support 
altscreen on

# bash will be replaced by the running command 
shelltitle " $ |bash"

screen 3
screen 2
screen 1

我不确定这是否重要,但我使用 ROXTerm 作为我的终端模拟器。

注意:我知道 Ctrl-A [ 可用于进入屏幕的复制模式回滚缓冲区。不过我不想用这个。我感兴趣的是为什么屏幕中的 Shift-PageUp 在某些机器上按预期工作,但在其他机器上完全被忽略。

编辑:我能够通过将 .screenrc 中的 termcapinfo 行更改为以下内容,在一台无法工作的机器上解决此问题:

termcapinfo xterm*|xs|rxvt ti@:te@

在一台不起作用的机器上,我的 $TERM 环境变量设置为 xterm-256color,那么是否可能没有“xterm-256color”的 termcap/terminfo 条目?

答案1

我不确定这是否有帮助(我不知道如何绑定 Shift 键),但我正在使用:

bindkey ^[[5;5~ eval "copy" "stuff ^U"
bindkey ^[[6;5~ eval "copy" "stuff ^D"

Ctrl在我的 .screenrc 中将+ Page Up/绑定Page Down到:

- 进入“复制”模式

-按Ctrl+ U/ D(因为它类似于 Vim 移动)

相关内容