当我远程登录 SLURM 交互节点时,emacs 有时会出现屏幕乱码。正如我在下面所描述的,我认为问题在于 SLURM 交互式节点弄乱了查询/确认终端信号,并且一些字符丢失导致故障。
设置
- 我实际与之交互的计算机:MacBook Air (10.13.2)
- 终端:iTerm2 Build 3.1.7
- SSH 到集群
- SLURM 交互节点(即
srun --nodes=1 ... --pty /bin/bash
) - emacs:终端模式下使用的 GNU Emacs 27.1(即
emacs -nw
)
当有许多窗格或移动大量文本时,似乎会发生更多。基于 emacs文档的这一部分,我尝试使用C-l (recenter-top-bottom)
重新绘制屏幕,并暂时修复了当前的故障。
通过设置$TERM=screen
或$TERM=xterm-256color
在我的.bash-profile
我看到不同的配色方案,但故障仍然存在。
请注意,我仅在登录交互式节点时才看到故障,而不是从集群上的头节点。利用在日志节点上没问题的事实,这可以提供有用的诊断信息。这让我怀疑问题是从集群发送的字符的 ENQ/ACK 或填充时间被丢弃了。这在terminfo 诊断程序的文档中进行了讨论。tack
tack
从登录节点和交互节点使用都给出相同的值
$ tack
Using terminfo from: /home/maom/opt/miniconda3/share/terminfo/x/xterm-256color
Name: xterm-256color|xterm with 256 colors
\r ^M (cr) = ^M
\n ^J (ind) = ^J
\b ^H (cub1) = ^H
\t ^I (ht) = ^I
(clear) = ^[[H^[[2J
(home) = ^[[H
ENQ (u9) = ^[[c
ACK (u8) = ^[[?1;2c
Terminal size: 204 x 52. Baud rate: 38400. Frame size: 10.0
Baudrate test
在登录节点上使用:
1600949 characters per second. Baudrate 52 Done
Baudrate test
在交互式节点上使用每秒字符数会慢约 30%:
1090426 characters per second. Baudrate 52 Done
并且,test ENQ/ACK handshake
在登录节点上使用给出:
Testing ENQ/ACK, standby...
This program expects the ENQ sequence to be answered with the ACK character. This will help the program reestablish synchronization when the terminal is overrun with data.
ENQ sequence from (u9): ^[[c
ACK received: ^[[?1;2c
Length of ACK 7. Expected length of ACK 7.
Terminating character found in (u8): c
test ENQ/ACK handshake
在交互式节点节点上使用时给出:
Testing ENQ/ACK, standby...
ACK terminating character: c
有没有什么办法可以更新 terminfo 来修复故障,并与集群管理员支持一起解决这个问题?