X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: Issue, most possibly with new Readline Date: Tue, 7 Feb 2006 20:01:05 +0000 (UTC) Lines: 63 Message-ID: References: <020620061506 DOT 20451 DOT 43E765E6000A9CB000004FE322007507840A050E040D0C079D0A AT comcast DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: List-Archive: List-Post: List-Help: , 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 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 TRD-CAX40JXD ~> / > > > ☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺ > > > > Here is my PS1: > > echo $PS1 > \[\e]61;\u \H\007\]\u \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/