Add input formatting for interactive CLI

When users type prompts in interactive mode, the input is now
reformatted in place with enhanced highlighting:

- ALL CAPS words (2+ chars) become bold green (e.g., FIX, BUG, HTTP2)
- Quoted text ("..." or ...) becomes cyan
- Standard markdown formatting is also supported

New module: input_formatter.rs with 10 unit tests
Integrated into interactive.rs for both single-line and multiline input
This commit is contained in:
Dhanji R. Prasanna
2026-01-30 12:03:36 +11:00
parent 2e21502357
commit 4e1694248f
3 changed files with 206 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ use crate::g3_status::{G3Status, Status};
use crate::project::Project;
use crate::project_files::extract_project_heading;
use crate::simple_output::SimpleOutput;
use crate::input_formatter::reprint_formatted_input;
use crate::template::process_template;
use crate::task_execution::execute_task_with_retry;
use crate::utils::display_context_progress;
@@ -246,6 +247,9 @@ pub async fn run_interactive<W: UiWriter>(
break;
}
// Reprint input with formatting
reprint_formatted_input(&input, &prompt);
execute_user_input(
&mut agent, &input, show_prompt, show_code, &output, from_agent_mode
).await;
@@ -271,6 +275,9 @@ pub async fn run_interactive<W: UiWriter>(
}
}
// Reprint input with formatting
reprint_formatted_input(&input, &prompt);
execute_user_input(
&mut agent, &input, show_prompt, show_code, &output, from_agent_mode
).await;