X-Recipient: archive-cygwin@delorie.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.9020805@charter.net>	<4CA0E317.6050701@veritech.com>	<4CA164CC.1060507@charter.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.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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

