Skip to content

mxqi: Borked terminal after forces job end of htop/vi #394

Open
donald opened this issue Jul 9, 2024 · 1 comment
Open

mxqi: Borked terminal after forces job end of htop/vi #394

donald opened this issue Jul 9, 2024 · 1 comment

Comments

@donald
Copy link
Collaborator

donald commented Jul 9, 2024

"nach dem return eines jobs im xterm, scrollt mein mausrad nicht mehr, sondern macht komische zeichen auf der konsole ..." , "aber nur, wenn ich htop starte und vom daemon rausgeworfen werde"

@donald
Copy link
Collaborator Author

donald commented Jul 9, 2024

Guess, this can happen with all applications modifying terminal modes with escape sequences, for example using curses). Same happens, if these applications are killed with -9.

This is what htop sends at the beginning:

\33[?1049h                                           # enable alternate screen buffer (xterm)
\33[1;64r                                            # set scrolling region 1,64
\33(B                                                # character set USASCII
\33[m                                                # Character Attributes (SGR): Normal (default), VT100.
\33[4l                                               # Reset Mode : Replace Mode (IRM)
\33[?7h                                              # Auto-Wrap Mode (DECAWM), VT100.
\33[?1h                                              # Application Cursor Keys (DECCKM), VT100.
\33=                                                 # Application Keypad (DECKPAM).
\33[?25l                                             # Hide cursor (DECTCEM), VT220.
\33[39;49m                                           # Set foreground color to default, ECMA-48 3rd.,Set background color to default, ECMA-48 3rd. 
\33[?1000h                                           # Send Mouse X & Y on button press

and this is the cleanup on normal termination:

\33[39;49m                                           # Set foreground color to default, ECMA-48 3rd.,Set background color to default, ECMA-48 3rd. 
\33(B                                                # character set USASCII
\33[m                                                # Character Attributes (SGR): Normal (default), VT100.
\r
\33[J                                                # Erase in Display: Selective Erase Below (default).
\33[?12l                                             # Stop blinking cursor (AT&T 610).
\33[?25h                                             # Show cursor (DECTCEM), VT220.
\33[?1000l                                           # Send Mouse X & Y on button press
\33[64;1H                                            # Cursor Position 64,1
\33[?1049l                                           # Use Normal Screen Buffer and restore cursor
\r
\33[?1l                                              # Normal Cursor Keys (DECCKM), VT100.
\33>                                                 # Normal Keypad (DECKPNM), VT100.

So in this case its "Application Cursor Keys (DECCKM), VT100". which could be reset by "\e[?1l". But there are million ways to configure the terminal and it depends on the terminal type. Also there might be the same problem with settings of the terminal device (not the terminal(-emulator)), like cooked mode etc. tset and reset are quite complex, takes ages and clear the screen.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant