Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Integrated Terminal Shell sometimes not used on launch for remote workspaces #128763

Closed
jmanthony3 opened this issue Jul 15, 2021 · 52 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) remote Remote system operations issues terminal Integrated terminal issues terminal-profiles
Milestone

Comments

@jmanthony3
Copy link

Issue Type: Bug

Opening VS Code automatically creates an integrated shell window, which is what I want. However, despite setting the "cmd.exe" shell as the default and commenting out the other options that only the "Command Prompt" shell is listed to create another terminal windows, the automatically created integrated shell window opens with PowerShell. I don't want PowerShell. If I add another terminal window, then that new window uses the "Command Prompt" shell.

VS Code version: Code 1.58.1 (2aeda6b, 2021-07-13T06:58:28.115Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2904)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.88GB (4.44GB free)
Process Argv --crash-reporter-id d17dcf09-a9c2-4505-9b94-904b43e5d3ee
Screen Reader no
VM 0%
@vscodebot
Copy link

vscodebot bot commented Jul 15, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@jmanthony3
Copy link
Author

Not a duplicate of suggestion as I am not splitting the terminal window. My issue pertains to initially created terminal window upon VS Code launch.

@neillindberg
Copy link

default_ignored
I searched for and found this issue is the same, just with different default settings. You can see in the dropdown that Git is my default shell, but after updating VSCode today it reopened with Powershell terminal for some reason. This has happened for several updates now.

@boldfrog1805
Copy link

Have same problem. If VSC exits with at least one Integrated Terminal running, it will re-run a single Integrated Termianl on startup. However it will not re-run any of the profiles that were previously running, nor the current default profile - it will just re-run the out-of-the-box default (in my case, vanilla bash to WSL2). Would be good to at least re-run the current default profile (best), or else have an option to not remember that an Integrated Terminal was running previously (OK).

@meganrogge
Copy link
Contributor

I believe this is already fixed, can you see if you can reproduce in the Insiders build?

@meganrogge meganrogge added the info-needed Issue requires more information from poster label Jul 27, 2021
@boldfrog1805
Copy link

boldfrog1805 commented Jul 29, 2021 via email

@amalaussena
Copy link

Hi, I am experiencing the same problem as reported above with Visual - see attached reproduction of the issue in a little movie.
It would be great if there were a fix for that issue, which is a blocking one on my project. Thanks, Anais

Visual.Code.Terminal.Issue.mp4

@meganrogge
Copy link
Contributor

i can't repro tihis. pls provide me with your settings @amalaussena

@amalaussena
Copy link

amalaussena commented Aug 2, 2021 via email

@meganrogge
Copy link
Contributor

can anyone provide me with their user settings? to do this, ctrl + comma and click the document looking button. copy that file

@boldfrog1805
Copy link

I'm not sure how @amalaussena 's video shows the problem? The problem happens when VSC launches (as the OP said), and that is not in the video. Anyway, my settings are below. I've pasted both User and Workspace as I have settings across both. And the terminal settings are in Workspace at the bottom. Hope this helps!

User

{
"files.associations": {
".cform": "yaml",
"
.gql": "graphql"
},
"yaml.customTags": [
"!And",
"!And sequence",
"!If",
"!If sequence",
"!Not",
"!Not sequence",
"!Equals",
"!Equals sequence",
"!Or",
"!Or sequence",
"!FindInMap",
"!FindInMap sequence",
"!Base64",
"!Join",
"!Join sequence",
"!Cidr",
"!Ref",
"!Sub",
"!Sub sequence",
"!GetAtt",
"!GetAZs",
"!ImportValue",
"!ImportValue sequence",
"!Select",
"!Select sequence",
"!Split",
"!Split sequence"
],
"yaml.validate": false,
"timeline.excludeSources": [],
"aws.samcli.location": "/home/linuxbrew/.linuxbrew/bin/sam",
"git.enableSmartCommit": true,
"git.confirmSync": false,
"explorer.confirmDragAndDrop": false,
"aws.onDefaultRegionMissing": "ignore",
"aws.profile": "profile:default",
"eslint.validate": [
"javascript",
"javascriptreact",
"vue"
],
"terminal.integrated.copyOnSelection": true,
"python.terminal.activateEnvironment": false,
"remote.SSH.remotePlatform": {
"emma": "linux",
"emma_media": "linux"
},
"workbench.editorAssociations": {
"*.ipynb": "jupyter-notebook"
},
"javascript.updateImportsOnFileMove.enabled": "never",
"python.languageServer": "Pylance",
"redhat.telemetry.enabled": false,
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
}
}

Workspace

{
"folders": [
{
"path": ".."
}
],
"settings": {
"python.pythonPath": ".venv/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"cfnLint.path": "./.venv/bin/cfn-lint",
"editor.rulers": [
100
],
"terminal.integrated.profiles.linux": {
"Project": {
"path": "bash",
"args": [
"--rcfile",
"${workspaceFolder}/.bashrc"
]
}
},
"terminal.integrated.defaultProfile.linux": "Project"
}
}

@amalaussena
Copy link

Hi @aupsloptp thanks for your help in this issue. The issue is that even if bash is set as the default terminal, when opening a new terminal VSC always selects cmd and there is no way to change this. This is the behaviour I tried to show in the video.
Based on your settings, are you able to switch from terminal shell eg. either cmd or powershell or bash? It yes, I would be interested to know what is the difference between your settings and mine? Thank you and Best Regards, Anais

@TicTak21
Copy link

TicTak21 commented Aug 6, 2021

I have the similar issue after last update: 1.60.0-insider.
Default profile option is still broken.

@IllusionMH
Copy link
Contributor

IllusionMH commented Aug 6, 2021

As mentioned above - issue can be reproduced in latest Insiders build
Setting "Command Prompt" or "Git Bash" to terminal.integrated.defaultProfile.windows still launches PowerShell

// "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
// "terminal.integrated.shellArgs.windows": ["--login", "-i"],
"terminal.integrated.profiles.windows": {
    "PowerShell": {
        "source": "PowerShell",
        "icon": "terminal-powershell"
    },
    "Command Prompt": {
        "path": [
            "${env:windir}\\Sysnative\\cmd.exe",
            "${env:windir}\\System32\\cmd.exe"
        ],
        "args": [],
        "icon": "terminal-cmd"
    },
    "Git Bash": {
        "source": "Git Bash"
    }
},
"terminal.integrated.defaultProfile.windows": "Git Bash",

terminal.integrated.profiles.windows is default configuration when you autocomplete this setting in settings.json file.
Old *shell* values are commented out.

Default terminal correctly marked in Launch profile dropdown
image

Version: 1.60.0-insider (user setup)
Commit: 49af1cb
Date: 2021-08-06T06:41:50.275Z
OS: Windows_NT x64 10.0.19041

@meganrogge
Copy link
Contributor

meganrogge commented Aug 6, 2021

in insider's today, there's an issue with the default profile that will be fixed tomorrow - #130268

I just re-read the OP description and think I now understand your problem. Commenting out the other shells won't work. You need to set them to null in your settings in order to remove them from appearing in the dropdown.

Please let me know if you are still seeing issues with this in tomorrow's insider's.

@boldfrog1805
Copy link

boldfrog1805 commented Aug 6, 2021

@meganrogge Can you please comment on the OP's post:

Not a duplicate of suggestion as I am not splitting the terminal window. My issue pertains to initially created terminal window upon VS Code launch.

The key words are "upon VS Code launch".

It does appear that somehow we are now looking at a different problem (the PowerShell one). Note that the OP also says "the automatically created integrated shell window". The problem as the OP described (and me) ONLY happens on VSC launch, not as @IllusionMH described.

See my original post, I am pretty sure that aligns with the OP. If the general consensus is not, then no problem, I will raise a new issue.

Maybe the title of this issue is the misleading bit? Maybe it should have been "Default Integrated Terminal Shell Upon Launch".

@adriantorrie
Copy link

  • Can confim happening on launch as @aupsloptp
  • Can confim it still happens after setting the default, and opening a new terminal as @IllusionMH

image

@meganrogge meganrogge changed the title Default Integrated Terminal Shell Default Integrated Terminal Shell sometimes not used on launch Aug 7, 2021
@meganrogge meganrogge added terminal-profiles bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Aug 7, 2021
@meganrogge
Copy link
Contributor

Can't repro, but seems like some people are seeing this still

@meganrogge meganrogge added this to the Backlog milestone Aug 7, 2021
@dippas
Copy link

dippas commented Aug 19, 2021

For me when (re)launching VSCode with terminal opened the powerShell shows, but if terminal is closed and then manually opened (ctrl + ç) then my default profile (git bash) is shown

@victorfeight
Copy link

victorfeight commented Aug 31, 2021

For me when (re)launching VSCode with terminal opened the powerShell shows, but if terminal is closed and then manually opened (ctrl + ç) then my default profile (git bash) is shown

This can be reproduced on my machine with the following settings:

    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash",
            "icon": "terminal-bash"
        },
    },
    "terminal.integrated.defaultProfile.windows": "Git Bash",

Opening a Project directory from Explorer with VS Code launches Code with a PowerShell terminal window. After deleting the PowerShell window (with delete button), and relaunching terminal Ctrl-` it reverts to Selected Git bash profile.

A temporary solution until this is fixed is to prevent the PowerShell profile from appearing in the menu by setting its source to "null"
"PowerShell": { "source": "null", "icon": "terminal-powershell" },
Thereby allowing Git Bash to open again by default.

@dippas
Copy link

dippas commented Aug 31, 2021

Opening a Project directory from Explorer with VS Code launches Code with a PowerShell terminal window. After deleting the PowerShell window (with delete button), and relaunching terminal Ctrl-` it reverts to Selected Git bash profile.

A temporary solution until this is fixed is to prevent the PowerShell profile from appearing in the menu by setting its source to "null"
"PowerShell": { "source": "null", "icon": "terminal-powershell" },
Thereby allowing Git Bash to open again by default.

It doesn't work setting "null" , it is even an invalid value

@Vidfinnx
Copy link

Vidfinnx commented Sep 2, 2021

Only workaround i found (after hours of thread reading and trying to edit settings.json with no success in getting it to stick) was downgrading to 1.59 where it functions perfectly, i didn't even know auto upgrades were a thing for vscode, all i know is i was working on a project just fine then later in the afternoon reopened vscode and this extremely annoying thing was happening. I am scared to death of auto updates and to update vscode period because it does this on the stable build as well, directly from the site. I have since now disabled auto updates. I am a coding student who is just now graduating school so my familiarity with vscode is very limited. I am on windows 10 64 bit

@alyssathi
Copy link

Having this issue after an auto update as well. Having issues with Windows 10 64 bit ignoring my default profile and opening up powershell.

@Vidfinnx
Copy link

Vidfinnx commented Sep 3, 2021

Having this issue after an auto update as well. Having issues with Windows 10 64 bit ignoring my default profile and opening up powershell.

Reinstall version 1.59 over the top of 1.60 and disable auto updates, that is what i have resorted to as a work around, just go into your settings and type update and disable them, except the extensions. I didn't lose anything by downgrading this way thank god, it was absolutely driving me nuts though not being able to set it to default and having powershell open for everything regardless of which one i chose.

@kohane27
Copy link

kohane27 commented Sep 3, 2021

I can report that I'm having the same issue. Rolled back to 1.59 and default shell as Git Bash works again. I also added "update.mode": "none" to settings.json

@ValHolla
Copy link

ValHolla commented Sep 3, 2021

I can confirm, using 1.60.0 still opens using powershell upon launch.

{
    "workbench.startupEditor": "newUntitledFile",
    "files.autoSave": "afterDelay",
    "git.autofetch": true,
    "workbench.editor.untitled.hint": "hidden",
    "python.formatting.blackPath": "/usr/local/bin/black",
    "python.formatting.provider": "black",
    "python.formatting.blackArgs": [
        "--line-length 100"
    ],
    "python.linting.flake8Args": [
        "--max-complexity 18",
        "--max-line-length 100"
    ],
    "python.linting.flake8Path": "/usr/local/bin/flake8",
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook"
    },
    "workbench.iconTheme": "vscode-icons",
    "yaml.customTags": [
        "!And",
        "!And sequence",
        "!If",
        "!If sequence",
        "!Not",
        "!Not sequence",
        "!Equals",
        "!Equals sequence",
        "!Or",
        "!Or sequence",
        "!FindInMap",
        "!FindInMap sequence",
        "!Base64",
        "!Join",
        "!Join sequence",
        "!Cidr",
        "!Ref",
        "!Sub",
        "!Sub sequence",
        "!GetAtt",
        "!GetAZs",
        "!ImportValue",
        "!ImportValue sequence",
        "!Select",
        "!Select sequence",
        "!Split",
        "!Split sequence"
    ],
    "yaml.validate": false,
    "python.venvFolders": [
        "venv"
    ],
    "python.venvPath": "~/venv",
    "window.zoomLevel": 1,
    "security.workspace.trust.untrustedFiles": "open",
    "extensions.supportVirtualWorkspaces": {
    
        "pub.name": false
    },
    "notebook.cellToolbarLocation": {
        "default": "right",
        "jupyter-notebook": "left"
    },
    "redhat.telemetry.enabled": false,
    "files.eol": "\n",
    "peacock.surpriseMeOnStartup": true,
    "peacock.affectStatusAndTitleBorders": true,
    "peacock.affectTabActiveBorder": true,
    "peacock.affectAccentBorders": true,
    "peacock.affectDebuggingStatusBar": true,
    "peacock.elementAdjustments": {
        "activityBar": "lighten",
        "statusBar": "darken",
        "titleBar": "none"
    },
    "peacock.favoriteColors": [
        {
            "name": "Angular Red",
            "value": "#dd0531"
        },
        {
            "name": "Azure Blue",
            "value": "#007fff"
        },
        {
            "name": "JavaScript Yellow",
            "value": "#f9e64f"
        },
        {
            "name": "Mandalorian Blue",
            "value": "#1857a4"
        },
        {
            "name": "Node Green",
            "value": "#215732"
        },
        {
            "name": "React Blue",
            "value": "#61dafb"
        },
        {
            "name": "Something Different",
            "value": "#832561"
        },
        {
            "name": "Svelte Orange",
            "value": "#ff3d00"
        },
        {
            "name": "Vue Green",
            "value": "#42b883"
        }
    ],
    "terraform.languageServer": {
        "external": true,
        "pathToBinary": "terraform-ls",
        "args": [
            "serve"
        ],
        "maxNumberOfProblems": 100,
        "trace.server": "off"
    },
    "git.enableSmartCommit": true,
    "terminal.integrated.defaultProfile.windows": "Git Bash"
}

@tinutmap
Copy link

tinutmap commented Sep 3, 2021

Confirming the issue still happens when I tried to run django/python and npm debug sessions.

Version: 1.60.0 (user setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

even when I tried to do the following in settings.json per https://code.visualstudio.com/docs/editor/integrated-terminal#_removing-builtin-profiles
The setting "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", helps in 1.59 but when auto updated to 1.60, that was overridden 😢 . Had to roll back to 1.59

{
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "terminal.integrated.profiles.windows": {
        "PowerShell": null,
        "Command Prompt": null,
        "GitBash": {
            "source": "Git Bash"
        },
    },
    "terminal.integrated.automationShell.windows": "GitBash",
    "terminal.integrated.defaultProfile.windows": "GitBash",
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "console": "integratedTerminal",
            "args": [
                "runserver",
                "0.0.0.0:8000"
            ],
            "django": true
        },
        {
            "command": "npm run serve",
            "name": "Run npm serve",
            "request": "launch",
            "type": "node-terminal",
        },
        {
            "name": "vuejs: Chrome",
            "request": "launch",
            "type": "chrome",
            "url": "http://localhost:8080",
            "breakOnLoad": true,
            "sourceMapPathOverrides": {
                "webpack:///src/*": "${webRoot}/*",
                "webpack:///./src/*": "${webRoot}/*",

            },
            "preLaunchTask": "npm: serve"
        }
    ],
    "compounds": [
        {
            "name": "Run both-ends",
            "configurations": ["Python: Django","vuejs: Chrome", ]
        }
    ],
}

@alexreg
Copy link

alexreg commented Sep 4, 2021

Per my issue concerning bash shells (#132312), I confirm this is still happening on the August stable release too.

@rofrol
Copy link

rofrol commented Sep 6, 2021

How to downgrade when using scoop ScoopInstaller/Scoop#4345 (comment)

@mohammadmjn
Copy link

mohammadmjn commented Sep 6, 2021

I'm experiencing this annoying issue after updating to 1.60.0 stable release. I mean when I close VS Code and open it again, at startup it opens PowerShell every time even after choosing Git Bash as default terminal.

Version: 1.60.0 (system setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 6.1.7601

And my setting.json is as follows:

"terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell",
      "icon": "terminal-powershell"
    },
    "Command Prompt": {
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe",
        "${env:windir}\\System32\\cmd.exe"
      ],
      "args": [],
      "icon": "terminal-cmd"
    },
    "Git Bash": {
      "source": "Git Bash",
      "icon": "terminal-bash"
    },
  },
  "terminal.integrated.defaultProfile.windows": "Git Bash",

@cdxn
Copy link

cdxn commented Sep 6, 2021

can we get an easy update until this is fixed? update to not open an integrated terminal on start?

@aleksandarbos
Copy link

aleksandarbos commented Sep 7, 2021

image

    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash"
        },
        "Cmder": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "env": {"CMDER_ROOT": "E:\\tools\\cmder"},
            "args": [
                "/K",
                "%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd"
            ],
            "icon": "cmder",
        }
    },
    "terminal.integrated.defaultProfile.windows": "Cmder",
Version: 1.60.0 (user setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

https://youtu.be/_CL6n0FJZpk?t=21

@IllusionMH
Copy link
Contributor

Should be already fixed in latest Insiders build
Version: 1.61.0-insider (user setup)
Commit: bb9491d
Date: 2021-09-07T05:17:08.586Z

@jmanthony3 could you check Insiders build to see if it still preproduces for you?

@dippas
Copy link

dippas commented Sep 7, 2021

Should be already fixed in latest Insiders build
Version: 1.61.0-insider (user setup)
Commit: bb9491d
Date: 2021-09-07T05:17:08.586Z

@jmanthony3 could you check Insiders build to see if it still preproduces for you?

Fixed here

@boldfrog1805
Copy link

Should be already fixed in latest Insiders build
Version: 1.61.0-insider (user setup)
Commit: bb9491d
Date: 2021-09-07T05:17:08.586Z

@jmanthony3 could you check Insiders build to see if it still preproduces for you?

Yep, fixed here too

@Tyriar
Copy link
Member

Tyriar commented Sep 7, 2021

/duplicate #132150

@Tyriar Tyriar closed this as completed Sep 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) remote Remote system operations issues terminal Integrated terminal issues terminal-profiles
Projects
None yet
Development

No branches or pull requests