@@ -237,7 +237,7 @@ impl ChatArgs {
237
237
let mut stderr = std:: io:: stderr ( ) ;
238
238
239
239
let args: Vec < String > = std:: env:: args ( ) . collect ( ) ;
240
- if args
240
+ if ! self . quiet && args
241
241
. iter ( )
242
242
. any ( |arg| arg == "--profile" || arg. starts_with ( "--profile=" ) )
243
243
{
@@ -287,7 +287,7 @@ impl ChatArgs {
287
287
. get_active ( )
288
288
. is_some_and ( |a| !a. mcp_servers . mcp_servers . is_empty ( ) )
289
289
{
290
- if !self . no_interactive && !os. database . settings . get_bool ( Setting :: McpLoadedBefore ) . unwrap_or ( false ) {
290
+ if !self . no_interactive && !self . quiet && ! os. database . settings . get_bool ( Setting :: McpLoadedBefore ) . unwrap_or ( false ) {
291
291
execute ! (
292
292
stderr,
293
293
style:: Print (
@@ -300,7 +300,7 @@ impl ChatArgs {
300
300
301
301
if let Some ( trust_tools) = self . trust_tools . take ( ) {
302
302
for tool in & trust_tools {
303
- if !tool. starts_with ( "@" ) && !NATIVE_TOOLS . contains ( & tool. as_str ( ) ) {
303
+ if !self . quiet && ! tool. starts_with ( "@" ) && !NATIVE_TOOLS . contains ( & tool. as_str ( ) ) {
304
304
let _ = queue ! (
305
305
stderr,
306
306
style:: SetForegroundColor ( Color :: Yellow ) ,
@@ -1661,7 +1661,9 @@ impl ChatSession {
1661
1661
}
1662
1662
1663
1663
async fn handle_input ( & mut self , os : & mut Os , mut user_input : String ) -> Result < ChatState , ChatError > {
1664
- queue ! ( self . stderr, style:: Print ( '\n' ) ) ?;
1664
+ if !self . quiet {
1665
+ queue ! ( self . stderr, style:: Print ( '\n' ) ) ?;
1666
+ }
1665
1667
user_input = sanitize_unicode_tags ( & user_input) ;
1666
1668
let input = user_input. trim ( ) ;
1667
1669
@@ -2190,7 +2192,12 @@ impl ChatSession {
2190
2192
) ?;
2191
2193
response_prefix_printed = true ;
2192
2194
}
2193
- buf. push_str ( & text) ;
2195
+ if self . quiet && buf. is_empty ( ) {
2196
+ // In quiet mode, trim leading whitespace from the first text
2197
+ buf. push_str ( text. trim_start ( ) ) ;
2198
+ } else {
2199
+ buf. push_str ( & text) ;
2200
+ }
2194
2201
} ,
2195
2202
parser:: ResponseEvent :: ToolUse ( tool_use) => {
2196
2203
if self . spinner . is_some ( ) {
@@ -2593,34 +2600,38 @@ impl ChatSession {
2593
2600
2594
2601
let tool_use = & self . tool_uses [ tool_index] ;
2595
2602
2596
- queue ! (
2597
- self . stdout,
2598
- style:: SetForegroundColor ( Color :: Magenta ) ,
2599
- style:: Print ( format!(
2600
- "🛠️ Using tool: {}{}" ,
2601
- tool_use. tool. display_name( ) ,
2602
- if trusted { " (trusted)" . dark_green( ) } else { "" . reset( ) }
2603
- ) ) ,
2604
- style:: SetForegroundColor ( Color :: Reset )
2605
- ) ?;
2606
- if let Tool :: Custom ( ref tool) = tool_use. tool {
2603
+ if !self . quiet {
2607
2604
queue ! (
2608
2605
self . stdout,
2609
- style:: SetForegroundColor ( Color :: Reset ) ,
2610
- style:: Print ( " from mcp server " ) ,
2611
2606
style:: SetForegroundColor ( Color :: Magenta ) ,
2612
- style:: Print ( tool. client. get_server_name( ) ) ,
2613
- style:: SetForegroundColor ( Color :: Reset ) ,
2607
+ style:: Print ( format!(
2608
+ "🛠️ Using tool: {}{}" ,
2609
+ tool_use. tool. display_name( ) ,
2610
+ if trusted { " (trusted)" . dark_green( ) } else { "" . reset( ) }
2611
+ ) ) ,
2612
+ style:: SetForegroundColor ( Color :: Reset )
2614
2613
) ?;
2614
+ if let Tool :: Custom ( ref tool) = tool_use. tool {
2615
+ queue ! (
2616
+ self . stdout,
2617
+ style:: SetForegroundColor ( Color :: Reset ) ,
2618
+ style:: Print ( " from mcp server " ) ,
2619
+ style:: SetForegroundColor ( Color :: Magenta ) ,
2620
+ style:: Print ( tool. client. get_server_name( ) ) ,
2621
+ style:: SetForegroundColor ( Color :: Reset ) ,
2622
+ ) ?;
2623
+ }
2615
2624
}
2616
2625
2617
- execute ! (
2618
- self . stdout,
2619
- style:: Print ( "\n " ) ,
2620
- style:: Print ( CONTINUATION_LINE ) ,
2621
- style:: Print ( "\n " ) ,
2622
- style:: Print ( TOOL_BULLET )
2623
- ) ?;
2626
+ if !self . quiet {
2627
+ execute ! (
2628
+ self . stdout,
2629
+ style:: Print ( "\n " ) ,
2630
+ style:: Print ( CONTINUATION_LINE ) ,
2631
+ style:: Print ( "\n " ) ,
2632
+ style:: Print ( TOOL_BULLET )
2633
+ ) ?;
2634
+ }
2624
2635
2625
2636
tool_use
2626
2637
. tool
0 commit comments