delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/02/18:17:03

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
Date: Wed, 2 Mar 2005 18:16:36 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: emacs shell mode prompt with escape sequences "\[\033]0;\w\007"
In-Reply-To: <4226452D.598BD3C4@dessent.net>
Message-ID: <Pine.GSO.4.61.0503021803050.2585@slinky.cs.nyu.edu>
References: <loom DOT 20050302T194426-703 AT post DOT gmane DOT org> <4226452D DOT 598BD3C4 AT dessent DOT net>
MIME-Version: 1.0

On Wed, 2 Mar 2005, Brian Dessent wrote:

> Perhaps a cleaner solution would be to modify the stock /etc/profile to
> detect whether it is running under bash or sh, and create an appropriate
> prompt.  I don't know who's maintaining the base-files package or
> whether he/she's interested in looking into this.

The stock /etc/profile already does that.  However, /etc/profile is only
invoked for login shells.  A regular shell invocation inherits PS1 from
the current shell.  Contrast

igor AT pechtcha ~
$ /bin/sh
\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ exit

igor AT pechtcha ~
$ (exec -l /bin/sh)
alias: not found
$ exit

Note: the "alias: not found" message results from /etc/profile.d/mc.sh (as
I've reported a while ago), but it may be an ash problem.  According to
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html>,
a POSIX-compliant shell should support the "alias" and "unalias" commands.
	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!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

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