Skip to content

Commit 3325682

Browse files
authored
Fix #1373: Prevent guide text output in no-interactive mode (#1437)
1 parent abf990a commit 3325682

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
@@ -786,20 +786,22 @@ impl ChatContext {
786786
.set_value("chat.greeting.rotating_tips_current_index", next_tip_index)?;
787787
}
788788

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

0 commit comments

Comments
 (0)