使用stty修改终端设置
2012-10-15 14:51
731 查看
在linux/unix平台上的sqlplus中,如果输错了字符,要想删除,习惯性的按下backspace键后,发现非但没有删除想要删掉的字符,还多出了两个字符^H。当然,我们可以同时按下ctrl+backspace键来删除,但对于习惯了用backspace来删除的用户,这样很不爽。这可以通过修改tty终端的设置来实现backspace删除功能。通过使用stty命令,就可以查看或者修改终端的按键设置。
例如,设置backspace为删除键:
[oracle10g@linux]$ stty erase ^h
如果要改回使用ctrl+backspace为删除键
[oracle10g@linux]$ stty erase ^?
如果需要重启后自动设置终端,可以将上述命令加入到profile中。
可以通过stty -a命令来查看所有的终端设置。下面是在linux下执行的输出:
[oracle10g@linux]$ stty -a
speed 38400 baud; rows 66; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ; eol2 = ; 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 -xcase -tostop -echoprt echoctl echoke
其中:
eof : 输入结束
erase : 向后删除字符,
intr : 中断当前程序
kill : 删除整条命令
quit :退出当前程序
start : 启动屏幕输出
stop :停止屏幕输出;
susp : terminal stop当前程序。
转载地址:http://www.ningoo.net/html/2007/using_stty_change_tty_setting.html
例如,设置backspace为删除键:
[oracle10g@linux]$ stty erase ^h
如果要改回使用ctrl+backspace为删除键
[oracle10g@linux]$ stty erase ^?
如果需要重启后自动设置终端,可以将上述命令加入到profile中。
可以通过stty -a命令来查看所有的终端设置。下面是在linux下执行的输出:
[oracle10g@linux]$ stty -a
speed 38400 baud; rows 66; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ; eol2 = ; 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 -xcase -tostop -echoprt echoctl echoke
其中:
eof : 输入结束
erase : 向后删除字符,
intr : 中断当前程序
kill : 删除整条命令
quit :退出当前程序
start : 启动屏幕输出
stop :停止屏幕输出;
susp : terminal stop当前程序。
转载地址:http://www.ningoo.net/html/2007/using_stty_change_tty_setting.html
相关文章推荐
- 使用stty修改终端设置
- 使用stty修改终端设置 stty 用法!
- 我使用过的Linux命令之stty - 显示和修改终端行设置
- 我使用过的Linux命令之stty - 显示和修改终端行设置
- Linux命令之stty - 显示和修改终端行设置
- Linux命令之stty - 显示和修改终端行设置
- Linux命令之stty - 显示和修改终端行设置
- stty命令_Linux stty 命令用法详解:修改终端命令行的相关设置
- Linux命令之stty - 显示和修改终端行设置(转载)
- Linux命令之stty - 显示和修改终端行设置
- Linux命令之stty - 显示和修改终端行设置
- Linux命令之stty - 显示和修改终端行设置
- Linux命令之stty - 显示和修改终端行设置
- Linux命令之stty - 显示和修改终端行设置
- 使用Mac自带Terminal(终端)修改Hosts详细图文教程
- 使用批处理修改web打印设置笔记 适用于IE
- iOS开发的一些小技术:让UIImage有缩放功能、控制log的输出、xcode修改文件注释、随机数的使用、在UIImageView 中旋转图像、在Quartz中如何设置旋转点、创建.plist文件并存储
- Linux使用笔记4-添加用户变量(设置自己的命令,修改默认python版本等)
- 使用SSH在做插入和修改的时候即使数据库中给字段设置了默认值还是没有用,在表对应的配置文件中也不知道该如何配置。。请教下。。
- FCKeditor 2.0 的设置.修改.使用