Code change:
} # Debug trapping/preexec inspired by starship (ISC) <del> __vsc_dbg_trap="$(trap -p DEBUG | cut -d' ' -f3 | tr -d ')" if [[ -z "$__vsc_dbg_trap" ]]; then </del> <ins> if [[ -n "${bash_preexec_imported:-}" ]]; then </ins> __vsc_preexec_only() { __vsc_status="$?" __vsc_preexec } <del> trap '__vsc_preexec_only "$_"' DEBUG elif [[ "$__vsc_dbg_trap" != '__vsc_preexec "$_"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$_"' ]]; then __vsc_preexec_all() { __vsc_status="$?" builtin eval ${__vsc_dbg_trap} __vsc_preexec } trap '__vsc_preexec_all "$_"' DEBUG </del> <ins> precmd_functions+=(__vsc_prompt_cmd) preexec_functions+=(__vsc_preexec_only) else __vsc_dbg_trap="$(trap -p DEBUG | cut -d' ' -f3 | tr -d ')" if [[ -z "$__vsc_dbg_trap" ]]; then __vsc_preexec_only() { __vsc_status="$?" __vsc_preexec } trap '__vsc_preexec_only "$_"' DEBUG elif [[ "$__vsc_dbg_trap" != '__vsc_preexec "$_"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$_"' ]]; then __vsc_preexec_all() { __vsc_status="$?" builtin eval ${__vsc_dbg_trap} __vsc_preexec } trap '__vsc_preexec_all "$_"' DEBUG fi </ins> fi __vsc_update_prompt

Related discussion:
text: Instead of 'success dots' in the gutter, all commands seem to think there are fail exit status. Here are my dotfiles: and a branch to help debug: The debug branch just build an array of what commands were that triggered the trap and print them at the start and end of building the prompt. It does show the trap being called twice when shell integration is enabled - and once otherwise. The repro environment/steps: Repros in OSX and WSL Ubuntu 22.04 for me. It uses dotbot. In a scratch user directory you can run ./install to link everything into ~/. Pass to ./install to avoid installing extra tooling it finds missing (pygments/tmux/coreutils)There is a script that get's sourced . This is the root of all evil. It's on the hacky side. The function is small and is (I believe) the only relevant part. I should stop using it, but it's sooooo_ ingrained into my muscle memory. To verify: Removing from makes everything work great with none of the above mentioned problems. One hack, that seems irrelevant is that uses debug trap directly, but also detects and uses the pre-exec infrastructure if it has been loaded (to not break iTerm2's shell integration). I appreciate the time and effort going into this feature. It's becoming a shockingly advanced embedded shell environment.
thanks again, planning on tackling this in June
I use just merged in a fix for this. It would be great if someone could help verify in tomorrow's insiders build as I'm not normally a user of bash-preexec.
Still some problems around . Very simple repro: clean environment. My bash and vscode versions are: use this .bashrc: For me (In WSL, repros in plain OSX): ! Without ! If extdebug works, then this would be the next simplest test (I think). Same clean environment. The following
Are there verif steps for this?
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!