I'd like to have the current
jobs status displayed in the title of my terminal. In Bash, I can use
PROMPT_COMMAND for that. Korn Shell (ksh93) doesn't have that.
Other answers suggest using command substitution inside
$PS1, which works fine in the general case, but not for the
jobs command. The problem here is that
jobs is concerned about the jobs of the current shell, but command substitution (i.e.
PS1='...$(jobs)...') is performed in a subshell, so there are no jobs.
The only mechanism I'm aware of is
trap '... jobs ...' DEBUG, but that would execute way too often. Do you know a way how to run commands in the context of the current shell, once on each prompt, or is this not possible in Korn shell?!