Date: Wed, 29 Aug 2007 16:07:16 +0200 From: "no@spam@mgedv.net" <nospam@mgedv.net> To: <freebsd-questions@freebsd.org> Subject: Re: /bin/sh vi mode command line editing and the period Message-ID: <000b01c7ea45$e7c55220$14b1a8c0@bstandard.lan> References: <000801c7e87d$bb64f420$14b1a8c0@bstandard.lan><6d62f69a0708270119n34c21b9dr6ab5caa287017da2@mail.gmail.com><001501c7e95b$5b6267e0$14b1a8c0@bstandard.lan><6d62f69a0708281055y54b9529fw337f1bc85bc85279@mail.gmail.com><006c01c7ea35$71559970$14b1a8c0@bstandard.lan> <6d62f69a0708290637i26fc3a3eh9bcb8f41666d71d2@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>> i just do the following: >> >> clear >> /bin/sh >> EDITOR=vi >> export EDITOR >> set -o $EDITOR >> echo 1 >> echo 2 >> echo 3 >> echo 4 >> <ESC-.> >> > I tested the command sequence you gave and the result was as you > explained. What caught my attention, however, was that all the > commands were builtin. I tested with non-builtin commands (eg. > /bin/echo instead of echo) and ESC-. did nothing. In fact unless the > last command was a builtin, ESC-. just repeated the last _editing_ > action. > This is not a desired behaviour however IMO, to repeat the last > command (if builtin) upon a ESC-. on an empty line. > Please correct me if I'm wrong. well, now i did this: /bin/sh EDITOR=vi export EDITOR set -o $EDITOR echo 1 >>foo echo 2 >>foo cat foo >>foo1 cat foo1 >>foo cat foo with this result: test# /bin/sh test# EDITOR=vi test# export EDITOR test# set -o $EDITOR test# echo 1 >>foo test# echo 2 >>foo test# cat foo >>foo1 test# cat foo1 >>foo test# cat foo 1 2 1 2 test# test# echo 2 >>foo test# cat foo >>foo1 test# cat foo1 >>foo test# cat foo 1 2 1 2 2 1 2 1 2 1 2 2 test# i took care that foo and foo1 did not exist prior to testing! but i'm still not sure whether i should file a PR or not. my assumption and expectance for ESC-. would be: (regardless whether the input line is empty or not) - ignore the key completely - execute the last executed command again (ignoring the content in the input buffer) still, it's risky, maybe the command should not get executed but pasted into the commandline like with ESC-- (minus). executing should also be fine - if it's just the last command and not the whole history. this is not a feature - for me it seems to be much more than senseless.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000b01c7ea45$e7c55220$14b1a8c0>