[gnu.bash.bug] slight readline modification

grady@fxgrp.fx.com (Steven Grady) (11/14/89)

First thing I want to say is that I'm way impressed with the input
editing features of bash (ie the readline library).  I'm very appreciative
of the work that went into making a good vi mode, especially.  And it
even has multiple undo!  Now, on to the suggestions...

I currently use tcsh, and one thing it does that bash's readline doesn't
is put the cursor at the _end_ of the line when you start moving through
the history (in either vi or emacs mode).  Having the cursor at the end
is slightly better since you're more likely to be editing the arguments
of an input line, or adding a redirection, than changing the program itself.
(At least that's true with me.)  Either method fits within the editing 
paradigm (if you look at it as though the cursor is at the end of the
current (empty) line before you start editing).  Perhaps it can be
configurable in the .inputrc?

While I'm here, how about if the display of the '*' at the beginning 
of modified history lines could be turned off.  Emacs users may be
used to it, but vi users aren't, and even when I use the emacs mode,
I find it kind of distracting.  The same goes for the current arg count.

Oh, and one more thing I suggested before but didn't see any response to.
Tcsh's prompt allows you to have something that's like bash's "\W"
(ie show only the tail of the current directory), but it also presents
your home directory as '~' (like the polite_directory_format of "\w"
in bash).  I'd like to see this in bash.  (If you want a new character,
perhaps "\.", which is similar to what tcsh uses ("%.")).

As Bartles and Jaymes say, "Thank you for your support".

	Steven
	...!ucbvax!grady
	grady@postgres.berkeley.edu

"...just when I had you wriggling in the crushing grip of reason, too..."

jeff1@garfield.mun.edu (Jeff Sparkes) (11/15/89)

>>>>> On 14 Nov 89 06:38:18 GMT, grady@fxgrp.fx.com (Steven Grady) said:

grady> First thing I want to say is that I'm way impressed with the
grady> input editing features of bash (ie the readline library).  I'm
grady> very appreciative of the work that went into making a good vi
grady> mode, especially.  And it even has multiple undo!  Now, on to
grady> the suggestions...

Actually, multiple undos are a sort of side effect.  Both multiple and
vi style will be in my next bunch.  I've even added undoable undos.

grady> I currently use tcsh, and one thing it does that bash's
grady> readline doesn't is put the cursor at the _end_ of the line
grady> when you start moving through the history (in either vi or
grady> emacs mode).  Having the cursor at the end is slightly better
grady> since you're more likely to be editing the arguments of an
grady> input line, or adding a redirection, than changing the program
grady> itself.  (At least that's true with me.)  Either method fits
grady> within the editing paradigm (if you look at it as though the
grady> cursor is at the end of the current (empty) line before you
grady> start editing).  Perhaps it can be configurable in the
grady> .inputrc?

Well, it's currently done the way that ksh does it, which is what *I*
expect.  Shouldn't be too hard to add a variable.  It does have to go
in the .inputrc, and not be yet another magic shell variable.

--
Jeff Sparkes	jeff1@garfield.mun.edu || uunet!garfield!jeff1
Humans couldn't have invented golf without alien intervention--Kids in the Hall

bfox%vision@HUB.UCSB.EDU (Brian Fox) (11/16/89)

   Posted-Date: 15 Nov 89 12:26:19 GMT
   Date: 15 Nov 89 12:26:19 GMT
   From: garfield!stretch!jeff1@uunet.uu.net  (Jeff Sparkes)
   Organization: Memorial University of Newfoundland
   References: <1989Nov14.063818.17288@fxgrp.fx.com>
   Sender: bug-bash-request@prep.ai.mit.edu

   >>>>> On 14 Nov 89 06:38:18 GMT, grady@fxgrp.fx.com (Steven Grady) said:

   grady> First thing I want to say is that I'm way impressed with the
   grady> input editing features of bash (ie the readline library).  I'm
   grady> very appreciative of the work that went into making a good vi
   grady> mode, especially.  And it even has multiple undo!  Now, on to
   grady> the suggestions...

   Actually, multiple undos are a sort of side effect.  Both multiple and
   vi style will be in my next bunch.  I've even added undoable undos.

You are VI fixated.  He is complementing the fact that Readline has
multiple undos.  For those who don't know, Jeff wrote the bulk of the
vi mode.

   grady> I currently use tcsh, and one thing it does that bash's
   grady> readline doesn't is put the cursor at the _end_ of the line
   grady> when you start moving through the history (in either vi or
   grady> emacs mode).  Having the cursor at the end is slightly
   better

This is simply false.  The cursor moves to the end of the line in
emacs mode.  Perhaps it doesn't do this in vi-mode?

Brian

jeff1@docboy.cs.mun.ca (Jeff Sparkes) (11/16/89)

Brian Fox writes:
 >    >>>>> On 14 Nov 89 06:38:18 GMT, grady@fxgrp.fx.com (Steven Grady) said:
 > 
 >    grady> First thing I want to say is that I'm way impressed with the
 >    grady> input editing features of bash (ie the readline library).  I'm
 >    grady> very appreciative of the work that went into making a good vi
 >    grady> mode, especially.  And it even has multiple undo!  Now, on to
 >    grady> the suggestions...
 > 
 >    Actually, multiple undos are a sort of side effect.  Both multiple and
 >    vi style will be in my next bunch.  I've even added undoable undos.
 > 
 > You are VI fixated.  He is complementing the fact that Readline has
 > multiple undos.  For those who don't know, Jeff wrote the bulk of the
 > vi mode.
 > 

	Oops.  It certainly does sound like I'm saying I wrote the
undo stuff.  Sorry about that.  I have added undoable undos, though,
but not sent them to Brian yet. He, of course, has done the bulk of
bash/readline work; I just hacked in some vi stuff.  Steven did say
that he liked vi mode though.
	NOTE: it appears that Brian is rabidly anti-vi.  Me, I live in
both worlds, but had gotten used to vi in ksh, so I decided to add it
to vi.

 >    grady> I currently use tcsh, and one thing it does that bash's
 >    grady> readline doesn't is put the cursor at the _end_ of the line
 >    grady> when you start moving through the history (in either vi or
 >    grady> emacs mode).  Having the cursor at the end is slightly
 >    better
 > 
 > This is simply false.  The cursor moves to the end of the line in
 > emacs mode.  Perhaps it doesn't do this in vi-mode?
 > 
 > Brian

It doesn't.  Sort of makes sense to me that it should be at the end,
but ksh didn't do it that way.

bfox%vision@HUB.UCSB.EDU (Brian Fox) (11/16/89)

   Date: 	Wed, 15 Nov 89 13:57:32 NST
   From: jeff1@docboy.cs.mun.ca (Jeff Sparkes)

	   NOTE: it appears that Brian is rabidly anti-vi.  Me, I live in
   both worlds, but had gotten used to vi in ksh, so I decided to add it
   to vi.

I am not rabid anything, and I am not anti-vi.  I am pro
good-software.  I am pro choice.  This means that I will (and have)
included code to handle cases that are not of interest to me, such as
vi mode.  I am even willing to spend time cleaning up and merging
other peoples code if enough people want the features.

    >    grady> I currently use tcsh, and one thing it does that bash's
    >    grady> readline doesn't is put the cursor at the _end_ of the line
    >    grady> when you start moving through the history (in either vi or
    >    grady> emacs mode).  Having the cursor at the end is slightly
    >    better
    > 
    > This is simply false.  The cursor moves to the end of the line in
    > emacs mode.  Perhaps it doesn't do this in vi-mode?
    > 
    > Brian

   It doesn't.  Sort of makes sense to me that it should be at the end,
   but ksh didn't do it that way.

I am not particularly interested in the way that Ksh does things.  I
am interested in implementing a good shell, called Bash.

I would imagine that keeping the cursor in the same column is the
right thing.

Brian

grady@fxgrp.fx.com (Steven Grady) (11/17/89)

   grady> I currently use tcsh, and one thing it does that bash's
   grady> readline doesn't is put the cursor at the _end_ of the line
   grady> when you start moving through the history (in either vi or
   grady> emacs mode).  Having the cursor at the end is slightly
   better

bfox>This is simply false.  The cursor moves to the end of the line in
bfox>emacs mode.  Perhaps it doesn't do this in vi-mode?

Oops.  I confused myself somehow.  Right, in emacs-mode it does
the Right Thing (IMHO).  In vi-mode it don't.  And speaking of vi-mode
problems, the 'dw' and 'cw' commands don't work quite right.  They
stop 1 character early.

	Steven
	...!ucbvax!grady
	grady@postgres.berkeley.edu

"Guards, beat this man brutally for daring to try to confuse me!"

andy@CSVAX.CALTECH.EDU (Andy Fyfe) (11/18/89)

In article <1989Nov16.180828.19985@fxgrp.fx.com> you write:
>And speaking of vi-mode
>problems, the 'dw' and 'cw' commands don't work quite right.  They
>stop 1 character early.

As do all forward moving commands, like df and ct.  Undoing them
doesn't put the cursor back where it should be.  The backward moving
varieties do seem to work correctly, though 'T' is not allowed.

For fun, try "c2fx" (the x doesn't matter in more ways than one!).
"2cfx" doesn't work either, but it's not nearly as much fun.

Andy Fyfe
            andy@csvax.caltech.edu
            wjafyfe@caltech.bitnet
            andy@cit-vax.UUCP	(...!ames!elroy!cit-vax!andy)