类似nslookup,openssl这样的应用在*nix下的terminal中怎么退格?

2013-12-30 12:43:04 +08:00
 tywtyw2002
不管是ssh连接还是本地xterm,nslookup和openssl都没法使用退格,退格自动变成了^H,打错了命令很麻烦,而且没法更改。。

有什么解决办法呢?

ps, 我记得有些程序,进入命令行打错了命令也是可以删除的,比如asterisk的cli模式。

可删除 / 出现^H这些程序在c中分别用了什么函数去获取stdin?
2437 次点击
所在节点    问与答
7 条回复
loryyang
2013-12-30 12:52:31 +08:00
ctrl+U, ctrl+w?
allenforrest
2013-12-30 13:36:15 +08:00
ctrl+backspace?
ericFork
2013-12-30 13:53:17 +08:00
用 ctrl+H 应该可以删
tywtyw2002
2013-12-30 14:50:46 +08:00
@loryyang
@ericFork
@allenforrest

ctrl+U, ctrl+w 可以直接删掉了整行
其他不行,
tywtyw2002
2013-12-30 14:59:37 +08:00
tyw@CosHiM-MAC:~|⇒ stty -a
speed 9600 baud; 25 rows; 80 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8
-ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
stop = ^S; susp = ^Z; time = 0; werase = ^W;



stty earse ^H
rrfeng
2013-12-30 18:31:38 +08:00
ctrl + backspace 是最简单的。
大部分程序可以吧 readlines 编译进去
实在不行的可以装一个 rlwrap ,用 rlwraq 来启动其他程序
tywtyw2002
2013-12-31 14:22:14 +08:00
@rrfeng ctrl + backspace 不work。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/95026

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX