I have a shell script that runs the same command in several directories (fgit). For each directory, I would like it to show the current prompt + the command which will be ru
Why don't you just process the $PS1 escape substitutions yourself? A series of substitutions such as these:
$PS1
p="${PS1//\\u/$USER}"; p="${p//\\h/$HOSTNAME}"
By the way, zsh has the ability to interpret prompt escapes.
print -P '%n@%m %d'
or
p=${(%%)PS1}