@@ -2183,12 +2183,10 @@ pub(super) fn command_mode(cx: &mut Context) {
21832183 static FUZZY_MATCHER: Lazy<fuzzy_matcher::skim::SkimMatcherV2> =
21842184 Lazy::new(fuzzy_matcher::skim::SkimMatcherV2::default);
21852185
2186− // we use .this over split_whitespace() because we care about empty segments
2187− let parts = input.split(' ').collect::<Vec<&str>>();
2188−
21892186 // simple heuristic: if there's no just one part, complete command name.
21902187 // 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 {
21922190 let mut matches: Vec<_> = typed::TYPABLE_COMMAND_LIST
21932191 .iter()
21942192 .filter_map(|command| {
@@ -2204,12 +2202,13 @@ pub(super) fn command_mode(cx: &mut Context) {
22042202 .map(|(name, _)| (0.., name.into()))
22052203 .collect()
22062204 } else {
2205+ let parts = shellwords::shellwords(input);
22072206 let part = parts.last().unwrap();
22082207
22092208 if let Some(typed::TypableCommand {
22102209 completer: Some(completer),
22112210 ..
2212− }) = typed::TYPABLE_COMMAND_MAP.get(parts[0])
2211+ }) = typed::TYPABLE_COMMAND_MAP.get(&parts[0] as &str)
22132212 {
22142213 completer(editor, part)
22152214 .into_iter()