From d72e60851b1f7c3ceda01ee3b10487ef761eb2d6 Mon Sep 17 00:00:00 2001 From: mikkurogue Date: Tue, 5 May 2026 21:39:26 +0300 Subject: [PATCH 1/3] Fix the fish setup to not run `command` but the actual parsed argv to prevent fish from breaking with `command` no such file or directory when using something like `vp env use 20`l --- crates/vite_global_cli/src/commands/env/setup.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/vite_global_cli/src/commands/env/setup.rs b/crates/vite_global_cli/src/commands/env/setup.rs index 6d4c48a1d4..d8980acd67 100644 --- a/crates/vite_global_cli/src/commands/env/setup.rs +++ b/crates/vite_global_cli/src/commands/env/setup.rs @@ -539,23 +539,23 @@ set -gx PATH __VP_BIN__ $PATH function vp if test (count $argv) -ge 2; and test "$argv[1]" = "env"; and test "$argv[2]" = "use" if contains -- -h $argv; or contains -- --help $argv - command vp $argv; return + __VP_BIN__/vp $argv; return end set -lx VP_ENV_USE_EVAL_ENABLE 1 - set -l __vp_out (env FISH_VERSION=$FISH_VERSION command vp $argv); or return $status + set -l __vp_out (env FISH_VERSION=$FISH_VERSION __VP_BIN__/vp $argv); or return $status eval (string join ';' $__vp_out) else - command vp $argv + __VP_BIN__/vp $argv end end # Dynamic shell completion for fish -VP_COMPLETE=fish command vp | source +VP_COMPLETE=fish __VP_BIN__/vp | source function __vpr_complete set -l tokens (commandline --current-process --tokenize --cut-at-cursor) set -l current (commandline --current-token) - VP_COMPLETE=fish command vp -- vp run $tokens[2..] $current + VP_COMPLETE=fish __VP_BIN__/vp -- vp run $tokens[2..] $current end complete -c vpr --keep-order --exclusive --arguments "(__vpr_complete)" "# From 13a04db8ee9504aa17b95518d7fb22fb17a4cc28 Mon Sep 17 00:00:00 2001 From: mikkurogue Date: Wed, 6 May 2026 11:04:00 +0300 Subject: [PATCH 2/3] Apply change to test to assert correctly for fish reflecting current change --- crates/vite_global_cli/src/commands/env/setup.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/vite_global_cli/src/commands/env/setup.rs b/crates/vite_global_cli/src/commands/env/setup.rs index d8980acd67..17cc53826d 100644 --- a/crates/vite_global_cli/src/commands/env/setup.rs +++ b/crates/vite_global_cli/src/commands/env/setup.rs @@ -1015,8 +1015,8 @@ mod tests { "env.fish should check for 'use' subcommand" ); assert!( - fish_content.contains("command vp $argv"), - "env.fish should use 'command vp' for passthrough" + fish_content.contains("/vp $argv"), + "env.fish should use absolute path to vp for passthrough" ); } From 75a2946cc1f8eff26888fa3bab53c49a0b37cb75 Mon Sep 17 00:00:00 2001 From: mikkurogue Date: Wed, 6 May 2026 13:31:35 +0300 Subject: [PATCH 3/3] revert some __VP_BIN__/ changes to use command again instead only on initial set should it use __VP_BIN__/ --- crates/vite_global_cli/src/commands/env/setup.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/vite_global_cli/src/commands/env/setup.rs b/crates/vite_global_cli/src/commands/env/setup.rs index 17cc53826d..fdf12d47fa 100644 --- a/crates/vite_global_cli/src/commands/env/setup.rs +++ b/crates/vite_global_cli/src/commands/env/setup.rs @@ -539,23 +539,23 @@ set -gx PATH __VP_BIN__ $PATH function vp if test (count $argv) -ge 2; and test "$argv[1]" = "env"; and test "$argv[2]" = "use" if contains -- -h $argv; or contains -- --help $argv - __VP_BIN__/vp $argv; return + command vp $argv; return end set -lx VP_ENV_USE_EVAL_ENABLE 1 set -l __vp_out (env FISH_VERSION=$FISH_VERSION __VP_BIN__/vp $argv); or return $status eval (string join ';' $__vp_out) else - __VP_BIN__/vp $argv + command vp $argv end end # Dynamic shell completion for fish -VP_COMPLETE=fish __VP_BIN__/vp | source +VP_COMPLETE=fish command vp | source function __vpr_complete set -l tokens (commandline --current-process --tokenize --cut-at-cursor) set -l current (commandline --current-token) - VP_COMPLETE=fish __VP_BIN__/vp -- vp run $tokens[2..] $current + VP_COMPLETE=fish command vp -- vp run $tokens[2..] $current end complete -c vpr --keep-order --exclusive --arguments "(__vpr_complete)" "#