3 ms·
That’s pretty cool. I wonder how JetBrains IDEs and VS Code manage to detect the installed shells (zsh, bash, PowerShell, etc.) in the first place since I certa
by zogrodea 3y ago
That’s pretty cool. I wonder how JetBrains IDEs and VS Code manage to detect the installed shells (zsh, bash, PowerShell, etc.) in the first place since I certainly have no idea how to do it in either Java or JavaScript. Maybe they write platform-specific code?
- gillesjacobs 3y agoOn linux the default shell is simply in the $SHELL env var.
- everforward 3y agoIt's also in $0 when you open a shell. I'm not sure how portable that is, though.
- vladvasiliu 3y agoOn Windows I have no idea, but on Linux it seems easy enough: » cat /etc/shells # Pathnames of valid login shells. # See shells(5) for details. /bin/sh /bin/bash /usr/bin/git-shell /bin/zsh /usr/bin/zsh /bin/rbash /usr/bin/rbash /usr/bin/bash /usr/bin/sh
- prmoustache 3y agoTrying to run it from its usual default path for each platform would be my guess.