Skip to content

Commit c36b342

Browse files
committed
Fix aws#1373: Prevent guide text output in no-interactive mode
1 parent 4cb1fce commit c36b342

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

crates/q_chat/src/lib.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -789,20 +789,22 @@ impl ChatContext {
789789
.set_value("chat.greeting.rotating_tips_current_index", next_tip_index)?;
790790
}
791791

792-
execute!(
793-
self.output,
794-
style::Print(if is_small_screen {
795-
SMALL_SCREEN_POPULAR_SHORTCUTS
796-
} else {
797-
POPULAR_SHORTCUTS
798-
}),
799-
style::Print(
800-
"━"
801-
.repeat(if is_small_screen { 0 } else { GREETING_BREAK_POINT })
802-
.dark_grey()
803-
)
804-
)?;
805-
execute!(self.output, style::Print("\n"), style::SetForegroundColor(Color::Reset))?;
792+
if self.interactive {
793+
execute!(
794+
self.output,
795+
style::Print(if is_small_screen {
796+
SMALL_SCREEN_POPULAR_SHORTCUTS
797+
} else {
798+
POPULAR_SHORTCUTS
799+
}),
800+
style::Print(
801+
"━"
802+
.repeat(if is_small_screen { 0 } else { GREETING_BREAK_POINT })
803+
.dark_grey()
804+
)
805+
)?;
806+
execute!(self.output, style::Print("\n"), style::SetForegroundColor(Color::Reset))?;
807+
}
806808
if self.interactive && self.all_tools_trusted() {
807809
queue!(
808810
self.output,

0 commit comments

Comments
 (0)