Index | Thread | Search

From:
Walter Alejandro Iglesias <wai@roquesor.com>
Subject:
Re: ksh vi mode: stop 'P' command from moving the cursor
To:
Pascal Stumpf <pascal@stumpf.co>
Cc:
Ingo Schwarze <schwarze@usta.de>, Anton Lindqvist <anton@basename.se>, millert@openbsd.org, tech@openbsd.org
Date:
Fri, 25 Apr 2025 11:04:15 +0200

Download raw body.

Thread
Hello Pascal,

On Thu, Apr 24, 2025 at 10:46:53PM +0200, Pascal Stumpf wrote:
> > So, which behaviour do people want?
> > 
> >  0) minimally invasive, 1P unchanged:
> >     p  unchanged -> to last character inserted
> >     1P unchanged -> after last character inserted
> >     2P changed to match 1P -> after last character inserted
> > 
> >  1) meximally invasive -> always to first charcter inserted
> >     like in our vi(1)
> > 
> >  2) minimally invasive, 2P unchanged -> always to last character inserted
> >     p  unchanged
> >     1P changed to match 2P
> >     2P unchanged
> 
> As a user of vi mode, I must say that I prefer option 2).  It is
> consistent among both the p and P commands, and also the behaviour of
> the ksh93 package, as well as all historical ksh versions I tested on
> sdf.org.  That is probably also the reason bash behaves this way.
> pdksh is the one that has an inaccuracy here in its implementation.

I forgot to mention in my report that I'd also tried ksh93 from ports.
Thanks, Pascal.  As I explained, I agree with you that this is the least
disruptive option (from a user perspective.)  However, Neil's
explanation of the problem with multiple pasting is worth considering
(to the point that I'm already leaning toward Ingo's option.)  Perhaps,
what would help in making the decision is if someone find some
disadvantage (again, from a user perspective) if this behavior of the
'P' command were maintained in ksh(1).  So far, I can't think of any; in
fact, I've been using vi mode in ksh(1) for years, and I'm just now
realizing the difference.


-- 
Walter