diff --git a/Cargo.lock b/Cargo.lock index 5f311f4e38..5e6ea515df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ dependencies = [ [[package]] name = "agent" -version = "1.19.4" +version = "1.19.5" dependencies = [ "amzn-codewhisperer-client", "amzn-codewhisperer-streaming-client", @@ -1418,7 +1418,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chat-cli-ui" -version = "1.19.4" +version = "1.19.5" dependencies = [ "chrono", "crossterm", @@ -1445,7 +1445,7 @@ dependencies = [ [[package]] name = "chat_cli" -version = "1.19.4" +version = "1.19.5" dependencies = [ "agent", "amzn-codewhisperer-client", @@ -6454,7 +6454,7 @@ dependencies = [ [[package]] name = "semantic_search_client" -version = "1.19.4" +version = "1.19.5" dependencies = [ "anyhow", "bm25", diff --git a/Cargo.toml b/Cargo.toml index 3eced0d620..b1d6504368 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Amazon Q CLI Team (q-cli@amazon.com)", "Chay Nabors (nabochay@amazon edition = "2024" homepage = "https://aws.amazon.com/q/" publish = false -version = "1.19.4" +version = "1.19.5" license = "MIT OR Apache-2.0" [workspace.dependencies] diff --git a/crates/chat-cli/src/cli/chat/cli/usage/usage_renderer.rs b/crates/chat-cli/src/cli/chat/cli/usage/usage_renderer.rs index 7125ba817b..7f9474bbde 100644 --- a/crates/chat-cli/src/cli/chat/cli/usage/usage_renderer.rs +++ b/crates/chat-cli/src/cli/chat/cli/usage/usage_renderer.rs @@ -147,7 +147,7 @@ pub async fn render_context_window( calculate_usage_percentage(usage_data.tools_tokens, usage_data.context_window_size) )), StyledText::info_fg(), - style::Print("█ Kiro responses: "), + style::Print("█ Q responses: "), StyledText::reset(), style::Print(format!( " ~{} tokens ({:.2}%)\n", diff --git a/crates/chat-cli/src/cli/chat/prompt.rs b/crates/chat-cli/src/cli/chat/prompt.rs index e58879c930..4d0ae92193 100644 --- a/crates/chat-cli/src/cli/chat/prompt.rs +++ b/crates/chat-cli/src/cli/chat/prompt.rs @@ -353,6 +353,16 @@ impl ChatHinter { return None; } + // Check for unclosed triple backticks + if line.contains("```") { + let triple_backtick_count = line.matches("```").count(); + if triple_backtick_count % 2 == 1 { + // We have an odd number of ```, meaning we're in multiline mode + // Show status hint (right arrow key is overridden to not complete this) + return Some("in multiline mode, waiting for closing backticks ```".to_string()); + } + } + // If line starts with a slash, try to find a command hint if line.starts_with('/') { return self @@ -550,6 +560,34 @@ impl rustyline::ConditionalEventHandler for PasteImageHandler { } } +/// Handler for right arrow key that prevents completing the multiline status hint +struct RightArrowHandler; + +impl rustyline::ConditionalEventHandler for RightArrowHandler { + fn handle( + &self, + _evt: &rustyline::Event, + _n: rustyline::RepeatCount, + _positive: bool, + ctx: &rustyline::EventContext<'_>, + ) -> Option { + let line = ctx.line(); + + // Check if we're in multiline mode with unclosed backticks + if line.contains("```") { + let triple_backtick_count = line.matches("```").count(); + if triple_backtick_count % 2 == 1 { + // We're in multiline mode - don't complete the hint + // Just move the cursor forward instead + return Some(Cmd::Move(rustyline::Movement::ForwardChar(1))); + } + } + + // Normal case - complete the hint + Some(Cmd::CompleteHint) + } +} + pub fn rl( os: &Os, sender: PromptQuerySender, @@ -643,6 +681,12 @@ pub fn rl( EventHandler::Conditional(Box::new(PasteImageHandler::new(paste_state))), ); + // Override right arrow key to prevent completing multiline status hints + rl.bind_sequence( + KeyEvent(KeyCode::Right, Modifiers::empty()), + EventHandler::Conditional(Box::new(RightArrowHandler)), + ); + Ok(rl) } diff --git a/crates/chat-cli/src/cli/feed.json b/crates/chat-cli/src/cli/feed.json index b4ba16b297..400048bdbd 100644 --- a/crates/chat-cli/src/cli/feed.json +++ b/crates/chat-cli/src/cli/feed.json @@ -10,6 +10,18 @@ "hidden": true, "changes": [] }, + { + "type": "release", + "date": "2025-11-12", + "version": "1.19.5", + "title": "Version 1.19.5", + "changes": [ + { + "type": "fixed", + "description": "Minor bug fixes" + } + ] + }, { "type": "release", "date": "2025-11-07",