From owner-freebsd-questions@FreeBSD.ORG Wed Aug 29 14:07:42 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4089716A46C for ; Wed, 29 Aug 2007 14:07:42 +0000 (UTC) (envelope-from nospam@mgedv.net) Received: from mail.mgedv.net (mail.mgedv.net [213.229.1.44]) by mx1.freebsd.org (Postfix) with ESMTP id DC5C813C46A for ; Wed, 29 Aug 2007 14:07:41 +0000 (UTC) (envelope-from nospam@mgedv.net) Received: from wzits045 (client.vpn.loop [192.168.177.20]) by mail.my.loop (mgedv) with ESMTP id 023991C4FD0 for ; Wed, 29 Aug 2007 16:07:14 +0200 (CEST) Message-ID: <000b01c7ea45$e7c55220$14b1a8c0@bstandard.lan> From: "no@spam@mgedv.net" To: 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> Date: Wed, 29 Aug 2007 16:07:16 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Subject: Re: /bin/sh vi mode command line editing and the period X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2007 14:07:42 -0000 >> i just do the following: >> >> clear >> /bin/sh >> EDITOR=vi >> export EDITOR >> set -o $EDITOR >> echo 1 >> echo 2 >> echo 3 >> echo 4 >> >> > 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.