delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/22/15:13:44

X-Spam-Check-By: sourceware.org
Date: Tue, 22 Nov 2005 15:13:32 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Robert Body <rbody99 AT hotmail DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: escape codes for ksh in /etc/profile ... was Re: mkpasswd, mkgroup - initial
In-Reply-To: <BAY104-F35726095F31831963AF48DAD520@phx.gbl>
Message-ID: <Pine.GSO.4.63.0511221507290.26963@slinky.cs.nyu.edu>
References: <BAY104-F35726095F31831963AF48DAD520 AT phx DOT gbl>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Tue, 22 Nov 2005, Robert Body wrote:

> I don't suppose there is a way of NOT letting %HOME% take priority over
> "/etc/passwd" for my home directory?

Yes.  Edit /Cygwin.bat and add "unset HOME" right before invoking bash.

> Brian,since you know about so many things, how come the following ksh
> doesn't work in
> 1) Linux xyz 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown
> 2) HP-UX xyz B.11.00 U 9000/785 2004606272 unlimited-user license
>
> the PS1 line below puts path into the title of the xterm, and puts
> "$PWD" into prompt and this works fine in bash (different section of
> /etc/profile), but not in ksh

bash uses a different set of escape codes.  The below is actually a bug in
the default /etc/profile -- the '^[' symbols should be literal Esc (0x1B)
characters, and '^G' should be 0x07 characters.  I've reported this
before, but it probably is time to bring it up again.

> ---------taken from cygwin's /etc/profile--------------------
> ...
> ksh*     | -ksh*     | */ksh* | \
> ksh*.exe | -ksh*.exe | */ksh*.exe )
>        # Set a HOSTNAME variable
>        typeset -l HOSTNAME
>
>        # Set a default prompt of: user AT host and current_directory
>        PS1='^[]0;${PWD}^G
> ^[[32m${USER}@${HOSTNAME} ^[[33m${PWD}^[[0m
> $ '
> -------------------------------------------------------------
> Basically the escape codes are being ignored in ksh,

Those aren't escape codes, those are improperly pasted control characters.

> but it came from cygwin's /etc/profile so it must be perfect right?

:-)

HTH,
	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!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

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