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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:20:24  来源:igfitidea点击:

Backspace doesn't work in sqlplus command line

sqloraclesqlplus

提问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-bwould 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:

按照此处的说明我能够执行以下操作并使其正常工作:

  1. Type stty erasein the terminal
  2. Press CTRL+von your keyboard
  3. Press the Backspace Keyon the keyboard (when I did this it put ^Hon the line so my final line looked like stty erase ^H)
  4. Press enter
  1. 输入stty erase终端
  2. CTRL+v你的键盘
  3. Backspace Key键盘上的(当我这样做时,它放在^H线上,所以我的最后一行看起来像stty erase ^H
  4. 按回车

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.

谢谢。