flathub / com.visualstudio.code

https://flathub.org/apps/details/com.visualstudio.code
149 stars 69 forks source link

`terminal.integrated.shell.linux` setting is deprecated #227

Open FlorianLudwig opened 3 years ago

FlorianLudwig commented 3 years ago

The flatpak-warning.txt provides the following advice:

To make the Integrated Terminal automatically use the host system's shell,
you can add this to the settings:

  {
    "terminal.integrated.shell.linux": "/usr/bin/env",
    "terminal.integrated.shellArgs.linux": ["--", "flatpak-spawn", "--host", "bash"]
  }

To which vs code answers:

This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in #terminal.integrated.profiles.linux# and setting its profile name as the default in #terminal.integrated.defaultProfile.linux#. This will currently take priority over the new profiles settings but that will change in the future.

Noxellar commented 3 years ago

Making the final few tweaks to my flatpak VSCode today and I found that this worked.

The whole quote is:

To make the Integrated Terminal automatically use the host system's shell,
you can add this to the settings:
{
    "terminal.integrated.defaultProfile.linux": "bash",
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "/usr/bin/flatpak-spawn",
            "args": ["--host", "--env=TERM=xterm-256color", "bash"]
        }
    }
}

You only need the first JSON key for it to work. Though I believe this solution kinda breaks the idea of security in Flatpak.

tunix commented 3 years ago

terminal.integrated.defaultProfile.linux doesn't accept anything besides "bash" despite you add different profiles under terminal.integrated.profiles.linux. In my case, my settings.json is like below and I can't make zsh the default:

"terminal.integrated.defaultProfile.linux": "zsh",
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "/usr/bin/flatpak-spawn",
            "args": ["--host", "--env=TERM=xterm-256color", "bash"]
        },
        "zsh": {
            "path": "/usr/bin/flatpak-spawn",
            "args": ["--host", "zsh"]
        },
        "fish": {
            "path": "fish"
        },
        "tmux": {
            "path": "tmux",
            "icon": "terminal-tmux"
        },
        "pwsh": {
            "path": "pwsh",
            "icon": "terminal-powershell"
        }
    },
pyrotek45 commented 2 years ago

i think its time to add toolbox inside the flatpak with vscode so devs don't have to use their host machines terminal anymore....

Nyaacinth commented 2 years ago

i think its time to add toolbox inside the flatpak with vscode so devs don't have to use their host machines terminal anymore....

Maybe a OS with toolbox preinstalled and use toolbox with "terminal.integrated.defaultProfile.linux"?