@@ -238,7 +238,7 @@ impl ChatArgs {
238
238
let mut stderr = std:: io:: stderr ( ) ;
239
239
240
240
let args: Vec < String > = std:: env:: args ( ) . collect ( ) ;
241
- if args
241
+ if ! self . quiet && args
242
242
. iter ( )
243
243
. any ( |arg| arg == "--profile" || arg. starts_with ( "--profile=" ) )
244
244
{
@@ -288,7 +288,7 @@ impl ChatArgs {
288
288
. get_active ( )
289
289
. is_some_and ( |a| !a. mcp_servers . mcp_servers . is_empty ( ) )
290
290
{
291
- if !self . no_interactive && !os. database . settings . get_bool ( Setting :: McpLoadedBefore ) . unwrap_or ( false ) {
291
+ if !self . no_interactive && !self . quiet && ! os. database . settings . get_bool ( Setting :: McpLoadedBefore ) . unwrap_or ( false ) {
292
292
execute ! (
293
293
stderr,
294
294
style:: Print (
@@ -301,7 +301,7 @@ impl ChatArgs {
301
301
302
302
if let Some ( trust_tools) = self . trust_tools . take ( ) {
303
303
for tool in & trust_tools {
304
- if !tool. starts_with ( "@" ) && !NATIVE_TOOLS . contains ( & tool. as_str ( ) ) {
304
+ if !self . quiet && ! tool. starts_with ( "@" ) && !NATIVE_TOOLS . contains ( & tool. as_str ( ) ) {
305
305
let _ = queue ! (
306
306
stderr,
307
307
style:: SetForegroundColor ( Color :: Yellow ) ,
@@ -1662,7 +1662,9 @@ impl ChatSession {
1662
1662
}
1663
1663
1664
1664
async fn handle_input ( & mut self , os : & mut Os , mut user_input : String ) -> Result < ChatState , ChatError > {
1665
- queue ! ( self . stderr, style:: Print ( '\n' ) ) ?;
1665
+ if !self . quiet {
1666
+ queue ! ( self . stderr, style:: Print ( '\n' ) ) ?;
1667
+ }
1666
1668
user_input = sanitize_unicode_tags ( & user_input) ;
1667
1669
let input = user_input. trim ( ) ;
1668
1670
@@ -2236,7 +2238,12 @@ impl ChatSession {
2236
2238
) ?;
2237
2239
response_prefix_printed = true ;
2238
2240
}
2239
- buf. push_str ( & text) ;
2241
+ if self . quiet && buf. is_empty ( ) {
2242
+ // In quiet mode, trim leading whitespace from the first text
2243
+ buf. push_str ( text. trim_start ( ) ) ;
2244
+ } else {
2245
+ buf. push_str ( & text) ;
2246
+ }
2240
2247
} ,
2241
2248
parser:: ResponseEvent :: ToolUse ( tool_use) => {
2242
2249
if self . spinner . is_some ( ) {
@@ -2639,34 +2646,38 @@ impl ChatSession {
2639
2646
2640
2647
let tool_use = & self . tool_uses [ tool_index] ;
2641
2648
2642
- queue ! (
2643
- self . stdout,
2644
- style:: SetForegroundColor ( Color :: Magenta ) ,
2645
- style:: Print ( format!(
2646
- "🛠️ Using tool: {}{}" ,
2647
- tool_use. tool. display_name( ) ,
2648
- if trusted { " (trusted)" . dark_green( ) } else { "" . reset( ) }
2649
- ) ) ,
2650
- style:: SetForegroundColor ( Color :: Reset )
2651
- ) ?;
2652
- if let Tool :: Custom ( ref tool) = tool_use. tool {
2649
+ if !self . quiet {
2653
2650
queue ! (
2654
2651
self . stdout,
2655
- style:: SetForegroundColor ( Color :: Reset ) ,
2656
- style:: Print ( " from mcp server " ) ,
2657
2652
style:: SetForegroundColor ( Color :: Magenta ) ,
2658
- style:: Print ( tool. client. get_server_name( ) ) ,
2659
- style:: SetForegroundColor ( Color :: Reset ) ,
2653
+ style:: Print ( format!(
2654
+ "🛠️ Using tool: {}{}" ,
2655
+ tool_use. tool. display_name( ) ,
2656
+ if trusted { " (trusted)" . dark_green( ) } else { "" . reset( ) }
2657
+ ) ) ,
2658
+ style:: SetForegroundColor ( Color :: Reset )
2660
2659
) ?;
2660
+ if let Tool :: Custom ( ref tool) = tool_use. tool {
2661
+ queue ! (
2662
+ self . stdout,
2663
+ style:: SetForegroundColor ( Color :: Reset ) ,
2664
+ style:: Print ( " from mcp server " ) ,
2665
+ style:: SetForegroundColor ( Color :: Magenta ) ,
2666
+ style:: Print ( tool. client. get_server_name( ) ) ,
2667
+ style:: SetForegroundColor ( Color :: Reset ) ,
2668
+ ) ?;
2669
+ }
2661
2670
}
2662
2671
2663
- execute ! (
2664
- self . stdout,
2665
- style:: Print ( "\n " ) ,
2666
- style:: Print ( CONTINUATION_LINE ) ,
2667
- style:: Print ( "\n " ) ,
2668
- style:: Print ( TOOL_BULLET )
2669
- ) ?;
2672
+ if !self . quiet {
2673
+ execute ! (
2674
+ self . stdout,
2675
+ style:: Print ( "\n " ) ,
2676
+ style:: Print ( CONTINUATION_LINE ) ,
2677
+ style:: Print ( "\n " ) ,
2678
+ style:: Print ( TOOL_BULLET )
2679
+ ) ?;
2680
+ }
2670
2681
2671
2682
tool_use
2672
2683
. tool
0 commit comments