Skip to content

Commit e44d94a

Browse files
authored
fix: bug bash /edit and formatting (#329)
1 parent ce3cf04 commit e44d94a

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

crates/chat-cli/src/cli/chat/cli/context.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The files matched by these rules provide Amazon Q with additional information
2828
about your project or environment. Adding relevant files helps Q generate
2929
more accurate and helpful responses.
3030
31-
Notes
31+
Notes:
3232
• You can add specific files or use glob patterns (e.g., \"*.py\", \"src/**/*.js\")
3333
• Profile rules apply only to the current profile
3434
• Global rules apply across all profiles
@@ -65,6 +65,8 @@ pub enum ContextSubcommand {
6565
#[arg(short, long)]
6666
global: bool,
6767
},
68+
#[command(hide = true)]
69+
Hooks,
6870
}
6971

7072
impl ContextSubcommand {
@@ -370,6 +372,18 @@ impl ContextSubcommand {
370372
)?;
371373
},
372374
},
375+
Self::Hooks => {
376+
execute!(
377+
session.stderr,
378+
style::SetForegroundColor(Color::Yellow),
379+
style::Print("The /context hooks command is deprecated. Use "),
380+
style::SetForegroundColor(Color::Green),
381+
style::Print("/hooks"),
382+
style::SetForegroundColor(Color::Yellow),
383+
style::Print(" instead.\n\n"),
384+
style::SetForegroundColor(Color::Reset)
385+
)?;
386+
},
373387
}
374388

375389
Ok(ChatState::PromptUser {

crates/chat-cli/src/cli/chat/cli/hooks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl HookExecutor {
393393
commands will be appended to the prompt to Amazon Q. Hooks can be defined
394394
in global or local profiles.
395395
396-
Notes
396+
Notes:
397397
• Hooks are executed in parallel
398398
• 'conversation_start' hooks run on the first user prompt and are attached once to the conversation history sent to Amazon Q
399399
• 'per_prompt' hooks run on each user prompt and are attached to the prompt, but are not stored in conversation history"

crates/chat-cli/src/cli/chat/cli/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ pub enum SlashCommand {
5353
/// Manage context files for the chat session
5454
#[command(subcommand)]
5555
Context(ContextSubcommand),
56-
/// Manage knowledge base for persistent context storage
56+
/// (Beta) Manage knowledge base for persistent context storage. Requires "q settings
57+
/// chat.enableKnowledge true"
5758
#[command(subcommand)]
5859
Knowledge(KnowledgeSubcommand),
5960
/// Open $EDITOR (defaults to vi) to compose a prompt

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,12 @@ impl ChatSession {
12511251
match SlashCommand::try_parse_from(args) {
12521252
Ok(command) => {
12531253
match command.execute(os, self).await {
1254-
Ok(chat_state) if matches!(chat_state, ChatState::Exit) => return Ok(chat_state),
1254+
Ok(chat_state)
1255+
if matches!(chat_state, ChatState::Exit)
1256+
|| matches!(chat_state, ChatState::HandleInput { input: _ }) =>
1257+
{
1258+
return Ok(chat_state);
1259+
},
12551260
Err(err) => {
12561261
queue!(
12571262
self.stderr,

0 commit comments

Comments
 (0)