From eff6c7c730d5f7e324a184b051962845ee0fa1ee Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Tue, 16 Jun 2026 04:46:27 +0300 Subject: [PATCH] fix(command-line): uppercase only the command verb, not arguments submit() uppercased the entire typed line, mangling case-sensitive arguments (file paths on case-sensitive filesystems, identifiers, plugin command args) on Linux/macOS. Uppercase only the first token; verbs still match and each sub-command handler already re-uppercases its own keywords. Co-Authored-By: Claude Opus 4.8 --- src/ui/command_line.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ui/command_line.rs b/src/ui/command_line.rs index b69ff80cb..0c4b0c894 100644 --- a/src/ui/command_line.rs +++ b/src/ui/command_line.rs @@ -73,13 +73,21 @@ impl CommandLine { } pub fn submit(&mut self) -> Option { - let cmd = self.input.trim().to_uppercase(); - if cmd.is_empty() { + let raw = self.input.trim().to_string(); + if raw.is_empty() { return None; } + // Uppercase only the command verb (the first token); keep arguments + // verbatim so case-sensitive values survive — file paths on + // case-sensitive filesystems, identifiers, plugin command arguments. + // Dispatch matches verbs in uppercase and each sub-command handler + // re-uppercases its own keywords, so only free-form args are affected. + let cmd = match raw.split_once(char::is_whitespace) { + Some((verb, rest)) => format!("{} {}", verb.to_uppercase(), rest), + None => raw.to_uppercase(), + }; // Record in recall list (avoid duplicates at the top). - let raw = self.input.trim().to_string(); - if self.cmd_recall.last().map(|s| s.as_str()) != Some(&raw) { + if self.cmd_recall.last().map(|s| s.as_str()) != Some(raw.as_str()) { self.cmd_recall.push(raw); if self.cmd_recall.len() > 50 { self.cmd_recall.remove(0);