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

Re: bash: display running foreground command in xterm title

On Wed, Jul 02, 2003 at 01:20:31AM +0200, Sebastian Kapfer wrote:
> 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're willing to make a minor change you could switch from bash to
zsh. zsh has a "preexec" function that runs after hitting Enter and
before starting the program. bash and zsh are extremely similar for
interactive use - they're both Bourne shells and they both support
almost all of the same command-line features like completion, history,
emacs/vi line editing, etc. Configuration is a little different, though.

Michael Heironimus

Reply to: