When the login shell exports PROMPT_COMMAND (for example from
/etc/profile), the bash shell integration line keeps that export, so
`su`, a nested `bash` and zellij panes inherit "__nyaterm_prompt; ..."
without the function. They print
"bash: __nyaterm_prompt: command not found" before every prompt, and
the user's own hook sees $? = 127.
For an exported PROMPT_COMMAND, call the hook through a variable that
is not exported. Child shells then skip it and run the rest of
PROMPT_COMMAND with the real $?. A non-exported PROMPT_COMMAND is
installed exactly as before.