microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 293 forks source link

terminal.integrated.profiles.linux shell args are not being passed correctly or shell modules not loaded correctly #10296

Closed red8888 closed 1 month ago

red8888 commented 1 month ago

Version: 1.92.0 (Universal) Commit: b1c0a14de1414fcdaa400695b4db1c0799bc3124 Date: 2024-07-31T23:26:45.634Z Electron: 30.1.2 ElectronBuildId: 9870757 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 OS: Darwin arm64 23.4.0

This issue only happens when launching an integrated terminal in a dev container and it only happens during launch. The zsh setting works after the shell is opened but not as a -o arg. Opening vscode sans dev container and launching terminal also works.

I'm trying to pass shell args like this:

    "terminal.integrated.defaultProfile.linux": "zsh",
    "terminal.integrated.profiles.linux": {
        "zsh": {
            "args": ["-o", "vi"]
        }
    },

Opening the integrated shell I can confirm this option is valid and works when I run set -o vi When I start the terminal with the above settings though I get this weird error (though it does open):

invalid module name `zsh/zle

After it opens vi mode is not enabled. If I manually run set -o vi at that point it is enabled and it works.

Is vscode mangling the shell options or something? Or is it doing something wrong with zsh modules?

bamurtaugh commented 1 month ago

cc @meganrogge @Tyriar on the terminal aspect

Tyriar commented 1 month ago

I'm guessing this is related to the fact that SHH/dev containers don't run a login shell like a regular desktop would, as such VS Code has a different looking environment.

chrmarti commented 1 month ago

Dev Containers probes the environment variables of the default shell in interactive login mode (similar to VS Code does for macOS and Linux).

@red8888 This works for me with the following devcontainer.json:

{
    "name": "Node.js & TypeScript",
    "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm"
}
vs-code-engineering[bot] commented 1 month ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!