From dba82ac5302b91c9e9ecd09c118f8a33949715d8 Mon Sep 17 00:00:00 2001 From: Russell Date: Mon, 30 Dec 2019 09:47:14 -0800 Subject: [PATCH] handle single quoted external command args (#1139) fixes #1138 --- src/commands/classified/external.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands/classified/external.rs b/src/commands/classified/external.rs index 876eac11c..13d7207a7 100644 --- a/src/commands/classified/external.rs +++ b/src/commands/classified/external.rs @@ -134,7 +134,11 @@ pub(crate) async fn run_external_command( let arg = shellexpand::tilde_with_context(arg.deref(), || home_dir.as_ref()); let arg_chars: Vec<_> = arg.chars().collect(); - if arg_chars.len() > 1 && arg_chars[0] == '"' && arg_chars[arg_chars.len() - 1] == '"' { + + if arg_chars.len() > 1 + && ((arg_chars[0] == '"' && arg_chars[arg_chars.len() - 1] == '"') + || (arg_chars[0] == '\'' && arg_chars[arg_chars.len() - 1] == '\'')) + { // quoted string let new_arg: String = arg_chars[1..arg_chars.len() - 1].iter().collect(); process = process.arg(new_arg);