mirror of
https://github.com/block/goose.git
synced 2026-07-09 16:09:22 +00:00
cli steering: show faint hint at start of each run
Print '↳ type a steering message and press Enter to queue it' (dim) when the steer reader activates, hiding/restoring the thinking spinner so it doesn't duplicate.
This commit is contained in:
parent
3587af2644
commit
818eaf52d5
2 changed files with 21 additions and 0 deletions
|
|
@ -1210,6 +1210,9 @@ impl CliSession {
|
|||
&& std::io::stdin().is_terminal()
|
||||
&& std::io::stdout().is_terminal();
|
||||
let (steer_control, mut steer_rx) = steer::spawn_steer_reader(steer_enabled);
|
||||
if steer_enabled {
|
||||
output::render_steer_hint();
|
||||
}
|
||||
|
||||
let mut stream = self
|
||||
.agent
|
||||
|
|
|
|||
|
|
@ -439,6 +439,24 @@ pub fn render_text_no_newlines(text: &str, color: Option<Color>, dim: bool) {
|
|||
print!("{}", styled_text);
|
||||
}
|
||||
|
||||
/// Print a faint hint that mid-run steering is available. Safe to call while
|
||||
/// the thinking spinner is active: the spinner is hidden first and restored
|
||||
/// after so it doesn't duplicate its line.
|
||||
pub fn render_steer_hint() {
|
||||
if !std::io::stdout().is_terminal() {
|
||||
return;
|
||||
}
|
||||
let was_thinking = THINKING.with(|t| t.borrow().is_shown());
|
||||
hide_thinking();
|
||||
println!(
|
||||
"{}",
|
||||
style("↳ type a steering message and press Enter to queue it").dim()
|
||||
);
|
||||
if was_thinking {
|
||||
show_thinking();
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw the live steer compose line. Called on every keystroke while the
|
||||
/// user types mid-run. When `in_place` is true the compose line was the last
|
||||
/// thing drawn, so it is redrawn over itself; otherwise it starts on a fresh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue