Problem with terminal, especially zsh
Hello!
My question: how can I set zsh terminal as default Vscodium terminal? I try many times to set it, but it's hell not working.
Inforation:
My settings.json:
{
"files.autoSave": "afterDelay",
"gopls": {
"ui.semanticTokens": true
},
"go.useLanguageServer": "explicit",
"go.languageServerFlags": [],
"go.toolsManagement.autoUpdate": "explicit",
"cSpell.language": "en,ru",
"files.exclude": {
"**/*.pyc": {"when": "$(basename).py"},
"**/__pycache__": true,
"**/.venv":true,
"**.idea":true,
},
"flake8.ignorePatterns": [
"E501"
],
"flake8.args": [
"--max-line-length=120"
],
"security.workspace.trust.untrustedFiles": "open",
"editor.minimap.size": "fill",
"editor.minimap.showSlider": "always",
"git.autofetch": true,
"git.openRepositoryInParentFolders": "never",
"[python]": {
"diffEditor.ignoreTrimWhitespace": true
},
"files.associations": {
"*.py": "python"
},
"editor.stickyScroll.enabled": false,
"interactiveWindow.executeWithShiftEnter": true,
"gigacode.inlineColor": "pink",
"workbench.colorCustomizations": {
"editorGhostText.foreground": "#FF47E9"
},
"gigacode.common.wholeLineCompletion": false,
"editor.suggest.showStatusBar": true,
"workbench.colorTheme": "Default Dark+",
"git.suggestSmartCommit": false,
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh",
"args": [],
"icon": "terminal-zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.external.linuxExec": "zsh"
}
It is definitely setted as zsh, but when I click New terminal I can select only two terminal's profiles:
How is working?
Is that path "/usr/bin/zsh" really OK? (you can try to run something like which zsh)
Is that path "/usr/bin/zsh" really OK? (you can try to run something like
which zsh)
Answer from standard terminal:
➜ ~ which zsh
/usr/bin/zsh
Answer from Vscodium:
sh-5.2$ which zsh
which: no zsh in (/app/bin:/app/bin:/app/bin:/usr/bin:/home/iwan/.var/app/com.vscodium.codium/data/node/bin:/home/iwan/.var/app/com.vscodium.codium/data/cargo/bin:/home/iwan/.var/app/com.vscodium.codium/data/python/bin:/home/iwan/.var/app/com.vscodium.codium/data/gem/ruby/3.2.0/bin)
.var/app so it seems to be sandboxed by flatpak.
Desktop (please complete the following information):
- OS: [e.g. Mac OS, Ubuntu 20.04, etc]
- Architecture [e.g. x64, ia32, arm64]
- Version [e.g. 1.33.0]
- App Manager [e.g. Winget, Homebrew, Snap, AUR, RPM, Nix, ...]
- Sandboxed [e.g. no, Flatpak, Snap]
.var/appso it seems to be sandboxed by flatpak.Desktop (please complete the following information):
- OS: [e.g. Mac OS, Ubuntu 20.04, etc]
- Architecture [e.g. x64, ia32, arm64]
- Version [e.g. 1.33.0]
- App Manager [e.g. Winget, Homebrew, Snap, AUR, RPM, Nix, ...]
- Sandboxed [e.g. no, Flatpak, Snap]
Version: 1.91.1 Release: 24193 Commit: 8512cb3341b26a5dba985a9a17eed8d7c3362886 Date: 2024-07-11T18:37:10.462Z Electron: 29.4.0 ElectronBuildId: undefined Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Linux x64 6.9.10-arch1-1 Sandboxed: flatpak installed
This solution worked for me:
- Install
host-spawn, e.g.sudo dnf install host-spawn - Add this lines to codium settings.json:
{
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/app/bin/host-spawn",
"args": ["zsh"],
"icon": "terminal-bash",
"overrideName": true
}
}
}
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, and we'll keep it open. If you have any new additional information, please include it with your comment!
Bumping issue. My problems started with my Python venv and eventually resulted in me figuring out that VSCodium kept rejecting zsh as a terminal option. I had a StackOverflow question about it that I'll bring in here as it is relevant.
@firefoxic does your solution still work? I can't get host-spawn on yay. I can add more information about my system if necessary.
hey I had the same issue I am using Pop! OS which in Ubuntu based @firefoxic answer worked for me
Understand the problem:
- The Flatpak app runs in an isolated sandbox;
- It can't access your real shell
(/usr/bin/zsh)directly.
Solution:
- you need
host-spawnto bridge between sandbox and host system
How to Check if You're Using Flatpak
flatpak list | grep codium
If you see output like: com.vscodium.codium, you are using the Flatpak version
If You Are Using the Flatpak Version:
1- Install host-spawn:
sudo apt install flatpak-xdg-utils
flatpak override --user --filesystem=host com.vscodium.codium
2- Update your settings like:
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/app/bin/host-spawn",
"args": ["zsh"],
"icon": "terminal-bash",
"overrideName": true
}
}
Good luck ;D