Change:
Issue Type: <bBug</bwhen i enable shell integration, i get an error: my contains: VS Code version: Code - Insiders 1.66.0-insider (, 2022-03-28T07:49:37.594Z) OS version: WindowsNT x64 10.0. Restricted Mode: No Remote OS version: Linux x64 5.10.60.1-microsoft-standard-WSL2 <details<summarySystem Info</summary </details<details<summaryExtensions (11)</summaryExtensionVersion ------ better-cpp-syntax1.15.13 remote-containers0.230.0 remote-ssh0.77. remote-ssh-edit0.77. remote-wsl0.66.0 doxdocgen1.4.0 better-cpp-syntax1.15.13 cmake-tools1.10.5 cpptools1.9.7 cpptools-extension-pack1.1.0 cmake0.0.17 (2 theme extensions excluded) </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
looks like you set somewhere which re-writes your . Right now if we detect possible problems with unsupported formats we bail out and disable shell integration by design. To workaround this you could point your at a function and run inside the function instead, for example
Assigning to April to see if we can improve our handling here.
no. i'm not setting . ugh. testing this is a nightmare. vscode seems to keep some persistent state on the server affecting shell startup. anyway, i'd recommend testing with my exact client/server OS combo. is set by the OS to the value above, but weirdly that's not actually what's used to echo my prompt. my prompt, as set in my file is .
It might be set in your or ? VS Code sources a shell environment on startup and that gets used as the base environment for terminals. For WSL you'd need the vscode server to shutdown fully.
no, this also happens when connecting (via ssh) to a fresh CentOS7 install.
<img width="965" alt="image" src="https://user-"
<img width="888" alt="Screen Shot 2022-03-31 at 17 04 04" src="https://user-"
It seems that works right on Manjaro X86_64 <img width="822" alt="image" src="https://user-"
Same here, with Arch and default As workaround I blanked the $PROMPT_COMMAND on my
Thanks for finding the , should make it easy to test against
the shell integration feature also breaks long line-wrapping in bash (happens on Ubuntu, too). the terminal wraps the line before reaching the right edge of the terminal window, and it wraps to the same line overwriting the existing ontents of that line. scrolling through line commands in the bash command history is completely broken.
Tentatively assigning to July as this gets hit with Arch's default

Discussion:
builtin unset VSCODE_INJECTION fi <del> # Disable shell integration if PROMPT_COMMAND is 2+ function calls since that is not handled. if [[ "$PROMPT_COMMAND" =~ .*(' '.*;)|(;.*' ').* ]]; then builtin unset VSCODE_SHELL_INTEGRATION builtin return fi </del> if [ -z "$VSCODE_SHELL_INTEGRATION" ]; then builtin return fi

__vsc_prompt_cmd_original() { __vsc_status="$?" <del> if [[ ${IFS+set} ]]; then __vsc_original_ifs="$IFS" fi if [[ "$__vsc_original_prompt_command" =~ .+;.+ ]]; then IFS=';' </del> <ins> # Evaluate the original PROMPT_COMMAND similarly to how bash would normally # See https://unix.stackexchange.com/a/672843 for technique if [[ ${#__vsc_original_prompt_command[@]} -gt 1 ]]; then for cmd in "${__vsc_original_prompt_command[@]}"; do __vsc_status="$?" eval "${cmd:-}" done </ins> else <del> IFS=' ' </del> <ins> eval "${__vsc_original_prompt_command:-}" </ins> fi <del> builtin read -ra ADDR <<<"$__vsc_original_prompt_command" if [[ ${__vsc_original_ifs+set} ]]; then IFS="$__vsc_original_ifs" unset __vsc_original_ifs else unset IFS fi for ((i = 0; i < ${#ADDR[@]}; i++)); do (exit ${__vsc_status}) builtin eval ${ADDR[i]} done </del> __vsc_precmd }

__vsc_precmd } <del> if [[ "$PROMPT_COMMAND" =~ (.+;.+) ]]; then # item1;item2... __vsc_original_prompt_command="$PROMPT_COMMAND" else # (item1, item2...) __vsc_original_prompt_command=${PROMPT_COMMAND[@]} fi </del> <ins> # PROMPT_COMMAND arrays and strings seem to be handled the same (handling only the first entry of # the array?) __vsc_original_prompt_command=$PROMPT_COMMAND </ins> if [[ -z "${bash_preexec_imported:-}" ]]; then if [[ -n "$__vsc_original_prompt_command" && "$__vsc_original_prompt_command" != "__vsc_prompt_cmd" ]]; then