delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/28/10:33:45

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4CA164CC.1060507@charter.net>
References: <4C9C6C3A DOT 9020805 AT charter DOT net> <4CA0E317 DOT 6050701 AT veritech DOT com> <4CA164CC DOT 1060507 AT charter DOT net>
Date: Tue, 28 Sep 2010 12:46:54 +0100
Message-ID: <AANLkTi=RpZuRT-xJw4COnSnbnTe8oie1mV2CzpVjc0oh@mail.gmail.com>
Subject: Re: Have idea for titlebar tweak -- need help with syntax
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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 28 September 2010 04:45, SJ Wright wrote:
> From what I've read so far, though, it appears that with bash
> I've backed the wrong horse, so far as getting the running process name =
=C2=A0in
> the title bar goes. The name of the shell is called by /s, I found out. I
> still wonder why Bourne (or his 'successors') didn't think a blind 'ps
> =C2=A0-head1' was worth setting an escape character for?

Because it would be no use at the time the prompt is printed: after
the last command.

You can use the trap builtin with the faux 'DEBUG' signal though to
execute a command just before a command is executed, and $BASH_COMMAND
will tell you what that command is. Here's one way to put this to use:

trap 'printf "\e]0;%s\a" "$BASH_COMMAND"' DEBUG

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019