[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash: display running foreground command in xterm title

On Tue, 01 Jul 2003 21:50:18 +0200, Paul Foote wrote:

> I gave it a little try, but the problem is figuring out which one is the
> forground proccess. the only way that I could figure it out was using w,
> and some grep magic, but its a well known fact that if you run w, or ps,
> or anything like that then that proccess becomes your forground process,
> avoiding the entire idea of doing this completely.

Yo :-)

> My suggestion is that
> you do some shell scripting to figure out each proccess running from that
> terminal and append it to the title, excluding bash.

But where can I plug in a shell script? When the user types in

$ rm -rf /

and pushes the Enter key - how will I know? csh seems to have a precmd
function which the user can define and which is executed before each
command. The only thing that comes close in bash is PROMPT_COMMAND. But
that's obviously executed _after_ a command was run.

> If you do pop into something that does fix this up (even a source patch to
> bash, but not like I really feel like playing with that any time soon) let
> the list know plz :)

I'm close to hacking bash out of pure frustration :-)

Best Regards,   |   Hi! I'm a .signature virus. Copy me into
 Sebastian      |   your ~/.signature to help me spread!

Reply to: