[GH-ISSUE #264] PROMPT_COMMAND issue #184

Closed
opened 2026-02-25 20:32:59 +03:00 by kerem · 2 comments
Owner

Originally created by @indutny on GitHub (Feb 22, 2018).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/264

Hello!

I've just updated to 2.0.0, and get this error every time I try to do a recording:

asciinema: press <ctrl-d> or type "exit" when you're done
sh: __prompt_command: command not found
sh-3.2$ exit

My .bash_profile has this:

export PROMPT_COMMAND=__prompt_command

__prompt_command() {
  local STATUS="$?"

  if [ $STATUS != 0 ]; then
    PS1="\w \[\e[0;31m\]$\[\e[0m\] "
  else
    PS1="\w $ "
  fi
}

Apparently __prompt_command got stripped out of the env, while PROMPT_COMMAND was preserved. Any way to fix it/work it around?

Originally created by @indutny on GitHub (Feb 22, 2018). Original GitHub issue: https://github.com/asciinema/asciinema/issues/264 Hello! I've just updated to 2.0.0, and get this error every time I try to do a recording: ``` asciinema: press <ctrl-d> or type "exit" when you're done sh: __prompt_command: command not found sh-3.2$ exit ``` My `.bash_profile` has this: ```sh export PROMPT_COMMAND=__prompt_command __prompt_command() { local STATUS="$?" if [ $STATUS != 0 ]; then PS1="\w \[\e[0;31m\]$\[\e[0m\] " else PS1="\w $ " fi } ``` Apparently `__prompt_command` got stripped out of the env, while `PROMPT_COMMAND` was preserved. Any way to fix it/work it around?
kerem closed this issue 2026-02-25 20:32:59 +03:00
Author
Owner

@ku1ik commented on GitHub (Feb 23, 2018):

Hey! I think the problem here is login vs non-login shell. See the second question here: https://asciinema.org/docs/faq

<!-- gh-comment-id:367938917 --> @ku1ik commented on GitHub (Feb 23, 2018): Hey! I think the problem here is login vs non-login shell. See the second question here: https://asciinema.org/docs/faq
Author
Owner

@indutny commented on GitHub (Feb 23, 2018):

It works, sorry for the noise!

<!-- gh-comment-id:368097126 --> @indutny commented on GitHub (Feb 23, 2018): It works, sorry for the noise!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#184
No description provided.