oracle Backspace 在 sqlplus 命令行中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23268579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Backspace doesn't work in sqlplus command line
提问by Alexis Sánchez Tello
In my sqlplus (for oracle) command line, the backespace doesn't work. How could I configure sqlplus for deleting characters from the command line with backspace? I don't use frequently sqlplus command line, only for making quickly interventions in my DB, it is very hazard for me the times I need to use.
在我的 sqlplus(for oracle)命令行中,backespace 不起作用。如何配置 sqlplus 以使用退格从命令行删除字符?我不经常使用sqlplus命令行,只是为了快速干预我的数据库,我需要使用的时间对我来说是非常危险的。
Kind Regards. Thanks
亲切的问候。谢谢
采纳答案by collapsar
which platform are you working on?
你在哪个平台上工作?
in case it's linux, have a look at this section of a wikipedia article on the bashfor some keyboard shortcuts. you should be able to navigate the sqlplus command line with the same shortcuts when you call sqlplus from the shell (bash). specifically, ctrl-b
would be backspace.
如果是 linux,请查看有关 bash 的维基百科文章的这一部分,了解一些键盘快捷键。当您从 shell (bash) 调用 sqlplus 时,您应该能够使用相同的快捷方式导航 sqlplus 命令行。具体来说,ctrl-b
将是退格。
回答by Chris Magnuson
Following the instructions hereI was able to do the following and get this working:
- Type
stty erase
in the terminal - Press
CTRL+v
on your keyboard - Press the
Backspace Key
on the keyboard (when I did this it put^H
on the line so my final line looked likestty erase ^H
) - Press enter
- 输入
stty erase
终端 - 按
CTRL+v
你的键盘 - 按
Backspace Key
键盘上的(当我这样做时,它放在^H
线上,所以我的最后一行看起来像stty erase ^H
) - 按回车
Now if I start up sql plus I can use the backspace key to delete mistyped characters.
现在,如果我启动 sql plus,我可以使用退格键来删除输入错误的字符。
回答by Alexis Sánchez Tello
Thank for your suggestions. In other forums I have found this workaround:
感谢您的建议。在其他论坛中,我找到了这个解决方法:
I have used stty -a for watching I/O settings: And I could see erase is set to ^?
我已经使用 stty -a 来查看 I/O 设置:我可以看到擦除设置为 ^?
So for setting the backspace for deleting characters I have set stty erase ^H, and then works for the session.
因此,为了设置删除字符的退格,我设置了 stty erase ^H,然后为会话工作。
Thanks.
谢谢。