1

Recently, for seemingly no reason, I've been getting the same issue as this thread:

bash how to remove "__bp_precmd_invoke_cmd" error?

However it only happens when I enter a screen session. Issuing unset PROMPT_COMMAND at the cli makes the problem go away for that screen session without any issue.

I added this then to my .screenrc, however the issue persists. What else am I missing?

2 Answers 2

1

From: https://www.gnu.org/software/screen/manual/screen.html

Add unsetenv PROMPT_COMMAND . to your .screenrc file.

0
0

The error is likely from https://github.com/rcaloras/bash-preexec which is included in the shell integration for the MacOS terminal emulator https://www.iterm2.com/ . The above solution works of unsetting PROMPT_COMMAND works; a better solution is to identify which shell script is causing the problem. If it is iTerm2, simply stop .bash{,_profile} sourcing the iterm integration.

Maybe an iTerm2 shell integration bug? It should check better whether iterm2 is the parent terminal, or give up if it is a terminal multiplexer such as tmux or screen. Personally, I found the iterm2 integration added complexity and confusion like this, and didn't make my life easier.

You may wish to only source the iterm2 integration if not in a multiplexer, and when iterm2 is not a parent terminal. Left as exercise for reader, or iTerm2 developers.

1
  • Ah this could be it, I am indeed using iTerm2. I have been using it (and shell integration) for longer than I think this error has been occurring but perhaps it's a recent update that's done it. I'll experiment and report back!
    – Joe Healey
    Dec 8, 2019 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.