通过man查看stty参数,-icannon的解释为:enable special characters: erase, kill, werase, rprnt,但不知道对这些参数的使能有何作用。
icanon选项是控制tty的Ctrl-H,Ctrl-W,Ctrl-U功能的,于是我做了下面的实验发现,还有更多
关闭icanon选项:stty -icanon
执行cat命令,然后输入hello world发现
①输入变为hheelloo wwoorrlldd
②Ctrl-W,Ctrl-D,Ctrl-H,Ctrl-X都不起作用了
重新开启icanon选项:stty icanon(注意没有中划线了)
执行cat,输入hello world,发现一切正常了