microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.55k stars 28.66k forks source link

terminal.integrated.defaultProfile and terminal.integrated.automationProfile behaves differently #140261

Open marhoy opened 2 years ago

marhoy commented 2 years ago

Does this issue occur when all extensions are disabled?: Yes

I can define my preferred terminal profile using the terminal.integrated.profiles.linux setting:

    "terminal.integrated.profiles.linux": {
        "zsh": {
            "path": "zsh",
            "args": [
                "--login"
            ],
            "env": {
                "TMUX": "false"
            }
        }
    },

...and I can specify this profile (referring to it by name) as my defaultProfile:

    "terminal.integrated.defaultProfile.linux": "zsh",

So this works fine for the standard built-in Terminal in VS Code.

However, I also want to use this terminal profile in the debugging-terminals. And according to the documentation, the setting terminal.integrated.automationProfile.linux should work like the terminal.integrated.defaultProfile.linux, allowing me to specify:

    "terminal.integrated.automationProfile.linux": "zsh",

But this does NOT work. The setting terminal.integrated.automationProfile.linux expects a dictionary/object like the terminal.integrated.profiles setting. But it only accepts keywords path and icon, so I'm not able to specify the args and env that I need.

Proposed fix: Make sure terminal.integrated.automationProfile behaves like terminal.integrated.defaultProfile (and according to the documentation), allowing us to specify a profile name defined in the terminal.integrated.profiles setting.

Tyriar commented 2 years ago

Passing over to @alexr00, not sure how tightly you want to control the environment/args in the automation profile. I'm guessing changing args isn't possible right now.

alexr00 commented 2 years ago

Tasks could support args, it's just another feature request.

codarch commented 2 years ago

I have the same problem (on Windows 10 using Visual Studio Code 1.66.0) and in my opinion it is more of a bug than a feature request.

Based on the naming and description I would expect terminal.integrated.automationProfile to behave the same as the terminal.integrated.defaultProfile setting (that is, it should be set to a profile name defined under terminal.integrated.profiles). But I cannot even provide a dictionary/object to it, because when I try to do so, I receive the following message from Visual Studio Code: Incorrect type. Expected "null".

So it just seems to be impossible to use the terminal.integrated.automationProfile at all.

ontoneio commented 2 years ago

Is there any movement on this issue? I am trying to debug using the terminal and I cannot set my node.js version because of this issue. There is not good documentation / intellisense, or examples as to why this breaks or how to configure your debug terminal vs the integrated terminal. Everything piece of documentation I have found isn't very clear on how to do this.

The VsCode documentation seems to be out of date with respect to this updated configuration.

TL;DR - I can't figure out how to configure the JS debug terminal to run the proper version of Node.js that works fine in my integrated terminal.

Tyriar commented 2 years ago

@ontoneio this issue is specific to tasks/debug, the JS debug terminal is different and actually part of the js-debug extension: https://github.com/microsoft/vscode-js-debug

bernardofm commented 2 years ago

Similar same problem here. I need to configure the env variables for automation profile to use with attach debugger.

The automation profile only works for tasks with the setting:

"type": "shell"

When launch the debugger, the automation profile env do not work at all.

dlicois commented 1 year ago

What is the state of this issue ? Solving this provides a solution to https://code.visualstudio.com/docs/editor/tasks#_why-do-i-get-command-not-found-when-running-a-task. Currently nvm or sdkman are unusable with vscode. This makes it very hard to work on multiple projects with different tools (node/npm but also java/maven/grddle).

furopi commented 1 year ago

What is the state of this issue ? Solving this provides a solution to https://code.visualstudio.com/docs/editor/tasks#_why-do-i-get-command-not-found-when-running-a-task. Currently nvm or sdkman are unusable with vscode. This makes it very hard to work on multiple projects with different tools (node/npm but also java/maven/grddle).

Same story over here... Hope this gets fixed soon! 🤞