* Michael Heironimus ([EMAIL PROTECTED]) [030702 15:05]: > 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.
Word. And just for the record, here's what I'm using in my .zshrc: #window titles case $TERM in screen*) preexec () {print -Pn "\ek$1\e\\\\\e]0;[EMAIL PROTECTED]: $1\a"} chpwd () {print -Pn "\e]0;[EMAIL PROTECTED]: %~\a"} ;; (E|a|k|x|dt)term*|rxvt) preexec () {print -Pn "\e]0;[EMAIL PROTECTED]: $1\a"} chpwd () {print -Pn "\e]0;[EMAIL PROTECTED]: %~\a"} ;; esac good times, Vineet -- http://www.doorstop.net/ -- "Extremism in the defense of liberty is no vice. Moderation in the pursuit of justice is no virtue." -- Barry Goldwater
signature.asc
Description: Digital signature