How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm title bar.
For ksh93 I was using:
alias command='command ' command 'cd' "$@" && setprompt && settitle I think I need something similar but for all commands?
I see Terminal.app on MacOS is determining the name of the invoked command somehow. I see the follow implementation for zsh, however I'm looking for ksh.
if [ "$SHELL" = '/usr/bin/zsh' ] then case $TERM in rxvt|*term) precmd() { print -Pn "\e]0;%m:%~\a" } preexec () { print -Pn "\e]0;$1\a" } ;; esac fi I'm reading this post on using ksh's DEBUG trap or poster also comments that "running a background task that regularly inspects the output of ps -o stat= -o args= to see which processes run in foreground and what command they are executing" is preferred. Does anyone have more information on this?