delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/09/11:30:05

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: Re: Issue, most possibly with new Readline
Date: Tue, 7 Feb 2006 20:01:05 +0000 (UTC)
Lines: 63
Message-ID: <loom.20060207T203625-615@post.gmane.org>
References: <020620061506 DOT 20451 DOT 43E765E6000A9CB000004FE322007507840A050E040D0C079D0A AT comcast DOT net> <f894c8ac0602060805r553957c4h486041d19f18063c AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

Zach Gelnett <zachg99 <at> gmail.com> writes:

> > >
> > > Basically, when I hit [ESC] then fwd slash (/) to search through the
> > > history, it throws my cursor back to get beginning of the line (on top
> > > of the prompt) and acts weird.  This is in mrxvt, now if I do the same
> > > in the basic cygwin bash shell i get this:
> > >
> > > v468929 <at> TRD-CAX40JXD ~> /
> > > ☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺
> >
> 
> Here is my PS1:
> 
>  echo $PS1
> \[\e]61;\u <at> \H\007\]\u <at> \H \W>

I reproduced this with readline-5.1-1, using a command.com window
($TERM=cygwin), so it might be an upstream bug or a cygwin terminal display
bug.  It looks like the readline command vi-search is displaying an
uninitialized buffer, whose width seems to track the prompt string length.
Once you have a command, the contents of the buffer are now initialized by
a previous command:

$ PS1='\[\e]61;\u@\H\007\]\u@\H \W> '
eblake AT eblake ~>  echo 01234567890123456789
01234567890123456789
eblake AT eblake ~>  [ESC]/        # Displays:
eblake AT eblake ~>  / ho 01234567890123456    # with cursor after /
eblake AT eblake ~>  PS1='\[\e]61;a\a\]123> '
123>  echo 01234567890123456789
01234567890123456789
123>  [ESC]/      # Displays:
123>  / 1='\[\      # with cursor after /
123>  PS1='\[\e]61;a\a\]1234> '
1234>  [ESC]/     # Displays:
1234>  / ='\[\e
1234>  PS1='\[\e]61;ab\a\]123> '
123>  [ESC]/      # Displays
123>  / 1='\[\e

Whether or not the extra characters are visible, making the one-line prompt
with invisible characters one character larger makes the buffer displayed
one character wider.

I'm trying to build a debugging version of readline to isolate the problem
before releasing readline-5.1-3.

> Basically, when using VI as the command line editor the [ESC] puts the
> line into command mode (just like pressing [ESC] within VI) then the /
> says search (again it's the same command within VI) for whatever you
> type next.  So, "/ls" would return the latest command line that
> included the letters "ls" and i can then press "n" to get the next
> occurrence and "N" to move the opposite direction through the history,
> it's quite handy.

emacs mode also has history searching commands; I am familiar with the
concept, it's just that I don't use vi mode.  Thanks for the extra hints on
how to test this.

--
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019