This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Have idea for titlebar tweak -- need help with syntax


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]