bug-bash
[Top][All Lists]
Advanced

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

preexec like behavior ? (feature request)


From: Tobias
Subject: preexec like behavior ? (feature request)
Date: Sat, 18 Oct 2003 17:05:21 +0200

Hello


According to http://www.tldp.org/HOWTO/Xterm-Title-5.html

---
5. Printing the current job name

Often a user will start a long-lived foreground job such as top, an editor, an 
email client, etc, and wishes the name of the job to be shown in the title. 
This is a more thorny problem and is only achieved easily in zsh.

5.1 zsh

zsh provides an ideal builtin function for this purpose:

preexec()   a function which is just before a command is executed
$*,$1,...   arguments passed to preexec()

Thus, we can insert the job name in the title as follows:

case $TERM in
    xterm*)
      preexec () {
        print -Pn "\e]0;$*\a"
      }
    ;;
esac
---

I think this functionality is missing in current bash. Right now you can
only change the look to the Title _AFTER_ the last command s executed.

PROMPT_COMMAND
If set, the value is executed as a command prior to issuing each primary
prompt.


There is a working patch at 
ftp://rvb.dyndns.org/pub/patches/bash-2.05b-preexec-0.3.diff.gz
which does modify the existing PROMPT_COMMAND Variable and allows me to do 
exactly that.
(patch is not done by me)

But it would be better to have a special variable to not break things on other 
computers.

Is it possible to add this functionality to bash ?? 
I wonder why its not added yet.


Greets

Tobias




reply via email to

[Prev in Thread] Current Thread [Next in Thread]