V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
tywtyw2002
V2EX  ›  问与答

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

  •  
  •   tywtyw2002 · 2013-12-30 12:43:04 +08:00 · 2431 次点击
    这是一个创建于 3787 天前的主题,其中的信息可能已经有所发展或是发生改变。
    不管是ssh连接还是本地xterm,nslookup和openssl都没法使用退格,退格自动变成了^H,打错了命令很麻烦,而且没法更改。。

    有什么解决办法呢?

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

    可删除 / 出现^H这些程序在c中分别用了什么函数去获取stdin?
    7 条回复    1970-01-01 08:00:00 +08:00
    loryyang
        1
    loryyang  
       2013-12-30 12:52:31 +08:00
    ctrl+U, ctrl+w?
    allenforrest
        2
    allenforrest  
       2013-12-30 13:36:15 +08:00
    ctrl+backspace?
    ericFork
        3
    ericFork  
       2013-12-30 13:53:17 +08:00
    用 ctrl+H 应该可以删
    tywtyw2002
        4
    tywtyw2002  
    OP
       2013-12-30 14:50:46 +08:00
    @loryyang
    @ericFork
    @allenforrest

    ctrl+U, ctrl+w 可以直接删掉了整行
    其他不行,
    tywtyw2002
        5
    tywtyw2002  
    OP
       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
        6
    rrfeng  
       2013-12-30 18:31:38 +08:00
    ctrl + backspace 是最简单的。
    大部分程序可以吧 readlines 编译进去
    实在不行的可以装一个 rlwrap ,用 rlwraq 来启动其他程序
    tywtyw2002
        7
    tywtyw2002  
    OP
       2013-12-31 14:22:14 +08:00
    @rrfeng ctrl + backspace 不work。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3445 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:46 · PVG 19:46 · LAX 04:46 · JFK 07:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.