Hi,
I use VSCode for remote development, when I install the file transfer trigger script (install.sh) in the server, I get an error when execute command in the internal terminal of VSCode: update_coreshell_cwd: command not found
.
I found that VSCode will modify $PROMPT_COMMAND
to "__vsc_prompt_cmd_original", how should the two software be compatible in this case, I seem to find the problem but can't solve it.
Thanks!
yang
(Yang.Y)
August 27, 2022, 8:12am
2
Hi,
I did a quick test on one of my server which has file direct transfer enabled, simply could not reproduce this issue.
I also found a similar issue report of VS Code:
opened 04:57PM - 05 Aug 22 UTC
closed 01:09PM - 10 Aug 22 UTC
bug
verified
insiders-released
terminal-shell-integration
terminal-shell-bash
Type: <b>Bug</b>
According to https://github.com/microsoft/vscode/issues/15… 0243 this was supposed to have been resolved, but I was able to reproduce it on 1.70 and the latest insiders build. Running `trap` does not produce any output, so I assume this is not related to https://github.com/microsoft/vscode/issues/150241. Let me know if there's any additional debugging I can do or info I can provide, but I think the context should be identical to the previous issue - aside from the exit code always being `1` instead of `0`.
VS Code version: Code 1.70.0 (da76f93349a72022ca4670c1b84860304616aaa2, 2022-08-04T04:38:48.541Z)
OS version: Linux x64 5.18.14-1-MANJARO snap
Modes:
<details>
<summary>System Info</summary>
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 3896)|
|GPU Status|2d_canvas: unavailable_software<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: disabled_software<br>multiple_raster_threads: enabled_on<br>opengl: disabled_off<br>rasterization: disabled_software<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: disabled_software<br>video_encode: disabled_software<br>vulkan: disabled_off<br>webgl: unavailable_software<br>webgl2: unavailable_software|
|Load (avg)|0, 0, 0|
|Memory (System)|15.28GB (0.46GB free)|
|Process Argv|--no-sandbox --force-user-env --unity-launch --crash-reporter-id 92f9d4a3-8422-4e6d-ba6a-5a6a7a7c1f55|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|plasma|
|XDG_CURRENT_DESKTOP|KDE|
|XDG_SESSION_DESKTOP|KDE|
|XDG_SESSION_TYPE|x11|
</details><details><summary>Extensions (82)</summary>
Extension|Author (truncated)|Version
---|---|---
reabank-syntax-highlighting|ada|1.1.0
toggle-hidden|adr|1.0.2
vscode-prisma-raw-query-sql|Aku|0.0.1
Bookmarks|ale|13.3.1
vscode-sqlite|ale|0.14.1
gitignore|cod|0.9.0
systemd-unit-file|coo|1.0.6
doxdocgen|csc|1.4.0
yash|dao|0.2.9
vscode-eslint|dba|2.2.6
javascript-ejs-support|Dig|1.3.1
gitlens|eam|12.1.2
EditorConfig|Edi|0.16.4
prettier-vscode|esb|9.5.0
vscode-firefox-debug|fir|2.9.8
vscode-jest-runner|fir|0.4.48
auto-rename-tag|for|0.1.10
code-runner|for|0.11.8
vscode-sql-tagged-template-literals-syntax-only|fri|0.0.19
go|gol|0.35.1
todo-tree|Gru|0.0.215
beautify|Hoo|1.5.0
dynamic-inputs|igr|0.0.15
latex-workshop|Jam|8.28.0
better-cpp-syntax|jef|1.15.19
cmake-language-support-vscode|jos|0.0.4
mips|kda|0.0.9
vscode-gutter-preview|kis|0.30.0
vscode-checkpoints|mic|1.3.3
dotenv|mik|1.0.1
vscode-apache|mrm|1.2.0
vscode-docker|ms-|1.22.1
csharp|ms-|1.25.0
vscode-dotnet-runtime|ms-|1.5.0
python|ms-|2022.12.0
vscode-pylance|ms-|2022.8.10
jupyter|ms-|2022.7.1002181843
jupyter-keymap|ms-|1.0.0
jupyter-renderers|ms-|1.0.9
remote-containers|ms-|0.241.3
remote-ssh|ms-|0.84.0
remote-ssh-edit|ms-|0.80.0
remote-wsl|ms-|0.66.3
cmake-tools|ms-|1.11.26
cpptools|ms-|1.11.4
cpptools-extension-pack|ms-|1.2.0
hexeditor|ms-|1.9.8
sqltools|mtx|0.23.0
gremlins|nho|0.26.0
angular-console|nrw|17.19.1
vetur|oct|0.35.0
explorer-exclude|Pet|1.3.1
polacode|pnp|0.3.4
prisma|Pri|4.1.0
fabric8-analytics|red|0.3.6
java|red|1.9.0
vscode-commons|red|0.0.6
rust|rus|0.7.8
scala|sca|0.5.6
metals|sca|1.18.0
markdown-preview-enhanced|shd|0.6.3
code-spell-checker|str|2.3.4
svelte-vscode|sve|105.20.0
sass-indented|syl|1.8.22
language-stylus|sys|1.16.0
pdf|tom|1.2.0
cmake|twx|0.0.17
lorem-ipsum|Tyr|1.3.1
unity-debug|Uni|3.0.2
vscodeintellicode|Vis|1.2.22
vscode-java-debug|vsc|0.43.0
vscode-java-dependency|vsc|0.21.0
vscode-java-pack|vsc|0.25.0
vscode-java-test|vsc|0.36.0
vscode-maven|vsc|0.37.0
volar|Vue|0.39.4
quokka-vscode|Wal|1.0.496
vscode-todo-highlight|way|1.0.5
vscode-nginx|wil|0.7.2
local-history|xyz|1.8.1
vscode-caddyfile-syntax|zam|1.0.4
vscode-proto3|zxh|0.5.5
(1 theme extensions excluded)
</details><details>
<summary>A/B Experiments</summary>
```
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vstes627cf:30244335
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
pylanb8912cf:30529770
vsclangdf:30486550
c4g48928:30535728
hb751961:30541207
dsvsc012:30540252
```
</details>
<!-- generated by issue reporter -->
Which version of VS Code are you using? And here is my version info:
Kindly Regards,
Yang
Indeed, I did a test on another windows host and did not find the problem. It seems that we only have different CPU architectures. We do not rule out this difference in implementation. In addition, maybe I installed some plugins in vscode? It seems almost impossible.
my vscode version info:
local extensions (Mac's VSCode):
Jupyter Keymap and Remote Development;
remote extensions (Ubuntu 20.04 LTS):
Anaconda Extension Pack, autoDocsing, Github Copilot, Python, Pylance and YAML.
yang
(Yang.Y)
August 29, 2022, 3:16am
4
Would you mind attach ~/.bashrc
and workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
in your remote server?
You can find the path of shellIntegration-bash.sh
by executing:
code --locate-shell-integration-path bash
Kindly Regards,
Yang
I put these files on GitHub for access. Thanks!!!
yang
(Yang.Y)
August 29, 2022, 7:23am
6
Thank you for the files. After comparing shellIntegration-bash.sh
files of your remote server and vscode repo, I found that the copy in your remote server is outdated:
microsoft:main
← emeric-martineau:fix/prompt_command
opened 12:03PM - 09 Aug 22 UTC
Fix @Tyriar commit dfc99af92ae923841caa055260deac9b61570725 `Simplify bash PROMP… T_COMMAND handling`.
What's happend ?
I use a modified PS1 for bash prompt:
```
function _update_ps1() {
PS1="$(/usr/local/bin/powerline-go -error $? -jobs $(jobs -p | /usr/bin/wc -l) -modules "user,host,cwd,perms,git,hg,jobs,exit,root")"
}
if [ "$TERM" != "linux" ] && [ -f "/usr/local/bin/powerline-go" ]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi
```
It works fine without VSCode terminal integration. `$?` return last exit code of command.
But, since VSCode 1.7.0, `$?` return value of `[[ ${#__vsc_original_prompt_command[@]} -gt 1 ]]` line (line [161](https://github.com/microsoft/vscode/blame/main/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh#L161)).
In my case, `$?` return always error.
Debug trace:
```
+ builtin unset VSCODE_INJECTION
...
++ __vsc_status=0
++ [[ 1 -gt 1 ]]
++ eval '_update_ps1; '
+++ _update_ps1
+++++ /usr/bin/wc -l
+++++ jobs -p
++++ /usr/local/bin/powerline-go -error 1 -jobs 0 -modules user,host,cwd,perms,git,hg,jobs,exit,root
+++ PS1='\[\e[38;5;250m\]\[\e[48;5;240m\] vagrant \[\e[48;5;238m\]\[\e[38;5;240m\]\[\e[0m\]\[\e[38;5;250m\]\[\e[48;5;238m\] mv-ulm \[\e[48;5;31m\]\[\e[38;5;238m\]\[\e[0m\]\[\e[38;5;15m\]\[\e[48;5;31m\] ~ \[\e[48;5;161m\]\[\e[38;5;31m\]\[\e[0m\]\[\e[38;5;15m\]\[\e[48;5;161m\] ERROR \[\e[48;5;161m\]\[\e[38;5;161m\]\[\e[0m\]\[\e[38;5;15m\]\[\e[48;5;161m\] \$ \[\e[0m\]\[\e[38;5;161m\]\[\e[0m\] '
```
In my case, `$?` return value of `[[ 1 -gt 1 ]]`.
fixes https://github.com/microsoft/vscode/issues/157206
It seems you have to upgrade vscode in your remote side.
Kindly Regards,
Yang