diff --git a/crates/nu-command/src/system/run_external.rs b/crates/nu-command/src/system/run_external.rs index e6708cfab8..8825d3700d 100644 --- a/crates/nu-command/src/system/run_external.rs +++ b/crates/nu-command/src/system/run_external.rs @@ -264,9 +264,13 @@ impl<'call> ExternalCommand<'call> { for arg in &self.args { let arg = trim_enclosing_quotes(arg); - let arg = nu_path::expand_path_with(arg, cwd) - .to_string_lossy() - .to_string(); + let arg = if arg.starts_with('~') || arg.starts_with("..") { + nu_path::expand_path_with(arg, cwd) + .to_string_lossy() + .to_string() + } else { + arg + }; let arg = arg.replace("\\", "\\\\");