skip to Main Content

Maybe about a week or so ago I noticed a weird problem when I use the Remote SSH Extension with tmux. After opening a terminal and starting tmux the following is printed to the console after every command:

-bash: __vsc_prompt_cmd_original: command not found

If I check the Log (Remote Pty Host) section of the Output tab I see the following:

[2022-08-19 14:48:23.822] [ptyhost] [warning] Shell integration cannot be enabled for executable "/bin/sh" and args ["-c","wget --version > /dev/nullnif [ $? -eq 0 ]nthenntwget --connect-timeout=7 --tries=1 --dns-timeout=7 -q --header='Metadata:true' -O - http://169.254.169.254/metadata/instance?api-version=2019-03-11nelsentcurl --version > /dev/nullntif [ $? -eq 0 ]ntthennttcurl --connect-timeout 7 -s --header='Metadata:true' http://169.254.169.254/metadata/instance?api-version=2019-03-11ntfinfinexit 0"]
[2022-08-19 14:48:23.890] [ptyhost] [warning] Shell integration cannot be enabled for executable "/bin/sh" and args ["-c","wget --version > /dev/nullnif [ $? -eq 0 ]nthenntwget --connect-timeout=7 --tries=1 --dns-timeout=7 -q  -O - http://169.254.169.254/latest/meta-data/instance-idnelsentcurl --version > /dev/nullntif [ $? -eq 0 ]ntthennttcurl --connect-timeout 7 -s  http://169.254.169.254/latest/meta-data/instance-idntfinfinexit 0"]
[2022-08-19 14:48:23.896] [ptyhost] [warning] Shell integration cannot be enabled for executable "/bin/sh" and args ["-c","wget --version > /dev/nullnif [ $? -eq 0 ]nthenntwget --connect-timeout=7 --tries=1 --dns-timeout=7 -q  -O - http://169.254.169.254/metadata/v1/idnelsentcurl --version > /dev/nullntif [ $? -eq 0 ]ntthennttcurl --connect-timeout 7 -s  http://169.254.169.254/metadata/v1/idntfinfinexit 0"]
[2022-08-19 14:48:23.900] [ptyhost] [warning] Shell integration cannot be enabled for executable "/bin/sh" and args ["-c","wget --version > /dev/nullnif [ $? -eq 0 ]nthenntwget --connect-timeout=7 --tries=1 --dns-timeout=7 -q --header='Metadata-Flavor:Google' -O - http://metadata.google.internal/computeMetadata/v1/instance/idnelsentcurl --version > /dev/nullntif [ $? -eq 0 ]ntthennttcurl --connect-timeout 7 -s --header='Metadata-Flavor:Google' http://metadata.google.internal/computeMetadata/v1/instance/idntfinfinexit 0"]
[2022-08-19 14:52:08.838] [ptyhost] [warning] Shell integration cannot be enabled for executable "/bin/tmux" and args undefined

The last line seems concerning, and if I use the Remote SSH extension for a different host (where tmux works) that line does not appear (leading me to believe the behavior is potentially connected).

Both remote hosts have terminal integration enabled (and disabling terminal integration doesn’t seem to do anything). Looking in the settings for VSCode terminal integration, I noticed that tmux is not listed as a supported shell for terminal integration (only bash, pwsh, and zsh are). I also see a warning that a complex bash PROMPT_COMMAND might also break things (and I have edited my PS1 to print the github branch I’m on, though that works on the other remote host just fine). The link in the settings (which I’ve reproduced here) is busted, there’s no #_complex-bash-promptcommand anchor on that page so that might be a red herring anyway.

Any thoughts? Should I submit a VSCode issue? Am I totally lost here?

2

Answers


  1. You can test the following method.

    Using an editor such as nano or vim, Add the line

    unset PROMPT_COMMAND

    to your .bashrc file, and it will take effect on the next session.

    To apply the change immediately for the life of the current shell session, type

    unset PROMPT_COMMAND
    in your terminal window.

    Login or Signup to reply.
  2. I met also the same thing tips "-bash: __vsc_prompt_cmd_original: command not found" in vscode. get rid of the tip to disable the following setting:

    {
      "terminal.integrated.shellIntegration.enabled": false
    }
    

    or UI settings:
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search