delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/22/19:56:24

X-Spam-Check-By: sourceware.org
Message-ID: <4383BE2B.11B20591@dessent.net>
Date: Tue, 22 Nov 2005 16:56:11 -0800
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: escape codes in ksh "\033]0;\$PWD\007\$PWD> "
References: <BAY104-F23586B23992790AC1B9DA6AD550 AT phx DOT gbl>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
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

Robert Body wrote:

> I have not been able to figure out how to send escape codes to ksh
> 
> I saw a syntax for ksh on
> http://www.steveshilling.pwp.blueyonder.co.uk/scripts/xtermtitle.txt
> ---------
> PS1='^[]0;${USER}@${HOST}: ${PWD}^Gksh$ '

I don't think ksh supports pasrsing of escape characters in environment
variables - but you'd have to ask Igor to be sure.  That means you have
to insert the literal escape character.

When you do this most shells will display it as "^[" even though it's
actually just one character, which is the source of your confusion.  For
example, at a bash prompt:

PS1='^[[33mYellow! $ ' ksh

(where again ^[ is not "^" and "[" but control-v then escape)

But what you probably want to do is set this in the .profile or
whatever.  To do that you'll have to do whatever incantation your chosen
text editor uses for inserting raw characters.  I think vim uses ^V too
- but I don't know because I don't use vim.

Brian

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