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: Subject: Re: Have idea for titlebar tweak -- need help with syntax From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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