Trouble when starting vscode from rofi

Hi,
I having trouble using vscode when starting it from rofi. When I do so, I’m having notification error telling me that vscode was not able to find a program called ocaml-lsp-server which is installed via opam (opam is sourced in my .zshrc).
When I start vscode from a terminal it works fine and ocaml-lsp-server is found correctly.
I’m not sure about why it does not work from rofi, any idea ?

Edit: opam does not seems to be in th PATH when I open vscode, so my .zshrc is not loaded ?

Edit 2: I’m starting sway with the command : /usr/bin/zsh -l -c sway from sway.desktop file in wayland-sessions. So I have no clue about why .zshrc is not loaded…

Thanks

Probably it start sh? It should symlink to bash…

file /bin/sh

Who starts sh ? vscode ?

No, you mentioned rofi and rofi probably starts programs with the default /usr/bin/sh which is on Manjaro /usr/bin/bash. Therefore, zsh will be ignored.

if I run echo $SHELL from a task inside vscode, it gives /usr/bin/zsh, so I thought it meant that zsh (and .zshrc) were loaded, but no…

Ok I found a way to fix this, by addind in vscode settings :
"terminal.integrated.profiles.linux": { "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } }

I tried many different things and settings before finding this exact one.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.