【问题标题】:Delete cannot erase chars under the cursor on my terminal删除无法擦除终端光标下的字符
【发布时间】:2015-03-18 09:49:41
【问题描述】:

相反,我得到了一个 ~ 字符。但是我已经将删除键设置如下:

speed 38400 baud; rows 47; columns 91; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = ^Z; 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
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -tostop echoctl echoke

有什么想法吗?

【问题讨论】:

    标签: terminal tty erase


    【解决方案1】:

    您的键盘上有多个键,可能称为“删除”。一些(按照惯例)发送一个单字节(这是stty 处理的),而另一些可能发送一个多字节(转义)序列。通常,您使用终端数据库处理后者,例如,使用 ncurses(以及终端数据库的 termcap 和 terminfo 接口)。

    这方面的一些方面在 xterm 常见问题解答中:Why doesn't my delete key work?

    【讨论】:

      猜你喜欢
      • 2019-06-06
      • 1970-01-01
      • 1970-01-01
      • 2012-08-07
      • 2021-05-15
      • 1970-01-01
      • 1970-01-01
      • 2011-01-13
      • 1970-01-01
      相关资源
      最近更新 更多