delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/29/16:10:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 29 Apr 2004 16:09:50 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "Buchbinder, Barry (NIH/NIAID)" <BBuchbinder AT niaid DOT nih DOT gov>
cc: "'Andrew DeFaria'" <Andrew AT DeFaria DOT com>, cygwin AT cygwin DOT com
Subject: RE: Line breaks in bash
In-Reply-To: <F76C9B2DA2FC4C4CA0A18E288BBCBCF70821786A@nihexchange24.nih.gov>
Message-ID: <Pine.GSO.4.56.0404291604050.6532@slinky.cs.nyu.edu>
References: <F76C9B2DA2FC4C4CA0A18E288BBCBCF70821786A AT nihexchange24 DOT nih DOT gov>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Thu, 29 Apr 2004, Buchbinder, Barry (NIH/NIAID) wrote:

> -----Original Message-----
> > From: Andrew DeFaria
> > Sent: Thursday, April 29, 2004 1:18 PM
> > To: cygwin<at>cygwin<dot>com
> > Subject: Re: Line breaks in bash
> >
> > When I type a long line in the bash shell it seems to get confused when
> > it passes the first 80 character barrier and does a newline. Below is an
> > example.
> >
> > C09-272-A:# why is it in bash that when I get close to typing 80
> > characters bash
> > does som
> > ething like this?
> >
> > Now set my prompt to the hostname as
> > "\[\e]0;\w\a\e[01;33mC09-272-A:\e[0m". Could this be causing the problem?
>
> Maybe you are missing a \] in the prompt.  What you really want is something
> like this:
> "\[\e]0;\w\a\e[01;33m\]C09-272-A:\[\e[0m\]"

Any sequence of non-printable characters should be enclosed in '\['..'\]'
for bash to not count it towards the current length of the line.

> (What are \w and \a doing?  man bash says that they should be the current
> working directory and a bell, but they don't act like that in this prompt
> for me.)

'\e]0;' will set the window title to the string that follows it (up to a
'\a', so that's the terminator).  So, the above should set the window
title to the current working directory, and the prompt will be displayed
as "C09-272-A:".  If you wanted the current working directory displayed in
the prompt, you could use "\[\e[01;33m\]C09-272-A:\w:\[\e[0m\]" instead.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
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