^? in stty output mean?

I'm trying to troubleshoot some terminal issues I'm having connecting from my Windows laptop to a linux server using the Git Bash shell. The screen does not appear to be refreshing properly (clear does not clear the screen, after exiting vim and man output stays on the screen, etc). I'm looking at the stty settings and comparing it with another linux server where I don't have these issues. One of things I see on my working server is eol = M-^?; eol2 = M-^?; eol = M-^?; eol2 = M-^?; . Can someone explain the notation to me? How can I replicate this setting on the other server?


stty is limited to single-byte characters.

bash uses the naming convention (as do a few other programs) of an M- prefix to denote the meta flag. Conventionally, ^? is ASCII DEL (127 decimal, 0x7f hex), so I would expect M-^? to be 255 (0xff).

Depending on the implementation (see discussion of _POSIX_VDISABLE ) stty might show that value as undef :

$ stty -a
speed 38400 baud; rows 40; columns 80; line = 0;
intr = ^C; quit = ^; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

Regarding meta, ncurses has some documentation in terminfo(5) :

If the terminal has a "meta key" which acts as a shift key, setting the 8th bit of any character transmitted, this fact can be indicated with km. Otherwise, software will assume that the 8th bit is parity and it will usually be cleared. If strings exist to turn this "meta mode" on and off, they can be given as smm and rmm .

and with the keyname function, it returns values in that form:

Values above 128 are either meta characters (if the screen has not been initialized, or if meta has been called with a TRUE parameter), shown in the MX notation, or are displayed as themselves. In the latter case, the values may not be printable; this follows the X/Open specification.

Further reading:

  • Alt-keys do not work in bash
  • 9.13 Why doesn't my Meta key work in an xterm window? (GNU Emacs FAQ)
  • what if _POSIX_VDISABLE value is -1?
  • 17.4.9 Special Characters (The GNU C Library)
  • 链接地址: http://www.djcxy.com/p/25708.html

    上一篇: 在具有'source'的Dockerfile中使用RUN指令不起作用

    下一篇: ^? 在stty输出意味着什么?