bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: readline: edit (mode:vi) means eol unreachable


From: Hugh Sasse
Subject: Re: readline: edit (mode:vi) means eol unreachable
Date: Thu, 8 Feb 2007 14:55:20 +0000 (WET)

On Thu, 8 Feb 2007, Chet Ramey wrote:

> Hugh Sasse wrote:
> 
> >> either they need to be in termcap/terminfo or you need to bind them
> >> yourself in .inputrc.  If the key sequence isn't bound, it will be
> > 
> > Either strategy is equally valid?  Well, I'm trying to get terminfo
> > right.  
> 
> Sure, either way is OK from readline's perspective -- the end result is
> identical.

OK, good.
> 
> > Then what is the correct behaviour when all is working?  
> > Should I be able to move left with the arrow keys and then move
> > far enough right to append, or should I have to hit <ESC><A>
> > to append?
> 
> You should be able to move right when in command mode, but need to hit
> ESC-a to go into append mode.  When in insert mode, you should be able

OK, the vi mode emulation as two modes I am happy with, and is working
for me.

> to move to the current end of line with the arrow keys, but those keys
> will not insert characters.

So if have a line consisting of "$ cbat", and I am in insert mode,
my cursor is after the "t", I am saying that from PuTTY, which has
the keys in the terminfo as described, then I can hit
<left><left><backspace> (to get rid of the "b", and then I can hit
<right> as many times as I like, but my cursor will remain on the
letter "t", and any text I type (still in insert mode) will end up
before the "t". For example typing " this" with the intention of
getting "$ cat this" I end up with "$ ca thist".  At no stage during
this process do I hit <ESC> to get out of insert mode.

Unfortunately, `script` only records what appears on the screen and
doesn't record keystrokes. So it is difficult to show you. It might
be possible to hack together an expect script to record this sort of
thing but it could take me a while.

So, is this behaving correctly, and I need to adjust my ideas of
what is correct, or not?  I think we've established that my terminfo
entry is correct (includes the right names and values and is being
picked up correctly).

> 
> Since vi is moded, you need a function to run to perform all of the
> actions needed to put you into append mode from command mode.

Yes. My problems occur when I move the cursor within insert mode
as is idiomatic within vim, and in non-vi readline (which like
emacs is effectively in insert mode all the time.
> 
> Chet
> 
        Thank you,
        Hugh




reply via email to

[Prev in Thread] Current Thread [Next in Thread]