mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Add support for ion, elvish, oil and nushell
Xonsh 0.9.14's which implementation is broken so I left it out: ```shell $ env -i HOME=$HOME xonsh -l -c 'which <anything>' xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True KeyError: 'PATH' ```
This commit is contained in:
@@ -47,15 +47,19 @@ pub fn verify_path_setup() -> Result<(), String> {
|
|||||||
|
|
||||||
let mut command = Command::new(&shell_path);
|
let mut command = Command::new(&shell_path);
|
||||||
let command = match shell {
|
let command = match shell {
|
||||||
// All of these shells support the `-l` flag to start a login shell and
|
// All of these shells support the `-l` flag to start a login shell and have a
|
||||||
// "-c<command>" to directly run a command under that login shell
|
// POSIX-compatible `command` builtin
|
||||||
"ash" | "bash" | "csh" | "ksh" | "dash" | "fish" | "sh" | "tcsh" | "zsh" => command
|
"ash" | "bash" | "csh" | "ksh" | "dash" | "fish" | "ion" | "sh" | "tcsh"
|
||||||
|
| "zsh" => command
|
||||||
.arg("-l")
|
.arg("-l")
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg("command -v yabridge-host.exe"),
|
.arg("command -v yabridge-host.exe"),
|
||||||
// I don't know if anyone uses PowerShell as their login shell under Linux, but it
|
// These shells either have their own implementation of `which` and don't support
|
||||||
// doesn't implement the POSIX `command` function so we'll just use which instead
|
// `command`, or they don't have a seperate login shell flag
|
||||||
|
"elvish" | "oil" => command.arg("-c").arg("command -v yabridge-host.exe"),
|
||||||
|
// xonsh's which implementation is broken as of writing this, so I left it out
|
||||||
"pwsh" => command.arg("-l").arg("-c").arg("which yabridge-host.exe"),
|
"pwsh" => command.arg("-l").arg("-c").arg("which yabridge-host.exe"),
|
||||||
|
"nu" => command.arg("-c").arg("which yabridge-host.exe"),
|
||||||
shell => {
|
shell => {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"{}",
|
"{}",
|
||||||
|
|||||||
Reference in New Issue
Block a user