简体   繁体   中英

Emacs garbled screen on SLURM interactive node

When I remotely login a SLURM interactive node, emacs will sometimes garble the screen. As I describe below, I think the issue is that the SLURM interactive node is messing up the Enquiry/acknowledgment terminal signals and some characters are getting dropped causing glitches.

Setup

  • Computer that I actually interact with: MacBook Air (10.13.2)
  • Terminal: iTerm2 Build 3.1.7
  • ssh to cluster
  • SLURM interactive node (ie srun --nodes=1 ... --pty /bin/bash )
  • emacs: GNU Emacs 27.1 used in terminal mode (ie emacs -nw )

Sometimes when the screen re-draws, it gets garbled: 乱码的emacs屏幕

It seems to happen more when the there are many panes or moving around lots of text. Based on this part of the emacs documentation , I tried using Cl (recenter-top-bottom) to re-draw the screen, and that temporarily fixes the current glitch.

By setting $TERM=screen or $TERM=xterm-256color in my .bash-profile I see different color schemes, but the glitches persist.

Note, I am only seeing the glitches when I login to the interactive node, not from the head node on the cluster. Using the fact that it is ok on the loging node, this can provide useful diagnostic information. This makes me suspect that the issue is that the ENQ/ACK or pad-timing for so characters sent from the cluster are getting dropped. This is discussed in the documentation for the tack terminfo diagnostics program.

Using tack from both the login node and the interactive node give the same values

$ 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

Using the Baudrate test on the login node :

1600949 characters per second.  Baudrate 52  Done

Using the Baudrate test on the interactive node the characters per second is about 30% slower:

1090426 characters per second.  Baudrate 52  Done

And, using the test ENQ/ACK handshake on the login node gives:

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

while using the test ENQ/ACK handshake on the interactive node node gives:

Testing ENQ/ACK, standby...

ACK terminating character: c

Is there someway I can update the terminfo to fix the glitches work with the cluster admin support to work around the issue?

I have experienced the same problem, and I don't know the best solution, but this could help. First, when you do srun it is better to pass -li on bash:

srun --nodes=1 ... --pty /bin/bash -li

This will make sure it loads the interactive bash profile you will usually open when you normally login.

This does not fix the issue completely for me, but but if I do tmux in the interactive session and then run emacs , then I don't have garbling problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM