@@ -2183,12 +2183,10 @@ pub(super) fn command_mode(cx: &mut Context) {
2183 static FUZZY_MATCHER: Lazy<fuzzy_matcher::skim::SkimMatcherV2> =
2183 static FUZZY_MATCHER: Lazy<fuzzy_matcher::skim::SkimMatcherV2> =
2184 Lazy::new(fuzzy_matcher::skim::SkimMatcherV2::default);
2184 Lazy::new(fuzzy_matcher::skim::SkimMatcherV2::default);
2186− // we use .this over split_whitespace() because we care about empty segments
2187− let parts = input.split(' ').collect::<Vec<&str>>();
2189 // simple heuristic: if there's no just one part, complete command name.
2186 // simple heuristic: if there's no just one part, complete command name.
2190 // if there's a space, per command completion kicks in.
2187 // if there's a space, per command completion kicks in.
2191− if parts.len() <= 1 {
2188+ // we use .this over split_whitespace() because we care about empty segments
2189+ if input.split(' ').count() <= 1 {
2192 let mut matches: Vec<_> = typed::TYPABLE_COMMAND_LIST
2190 let mut matches: Vec<_> = typed::TYPABLE_COMMAND_LIST
2194 .filter_map(|command| {
2192 .filter_map(|command| {
@@ -2204,12 +2202,13 @@ pub(super) fn command_mode(cx: &mut Context) {
2204 .map(|(name, _)| (0.., name.into()))
2202 .map(|(name, _)| (0.., name.into()))
2205 .collect()
2203 .collect()
2206 } else {
2204 } else {
2205+ let parts = shellwords::shellwords(input);
2207 let part = parts.last().unwrap();
2206 let part = parts.last().unwrap();
2209 if let Some(typed::TypableCommand {
2208 if let Some(typed::TypableCommand {
2210 completer: Some(completer),
2209 completer: Some(completer),
2212− }) = typed::TYPABLE_COMMAND_MAP.get(parts[0])
2211+ }) = typed::TYPABLE_COMMAND_MAP.get(&parts[0] as &str)
2214 completer(editor, part)
2213 completer(editor, part)
2215 .into_iter()
2214 .into_iter()