Completely pointless ascii art (#7329)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -479,7 +479,6 @@ impl CliSession {
|
|||||||
let history_manager = HistoryManager::new();
|
let history_manager = HistoryManager::new();
|
||||||
history_manager.load(&mut editor);
|
history_manager.load(&mut editor);
|
||||||
|
|
||||||
output::display_greeting();
|
|
||||||
loop {
|
loop {
|
||||||
self.display_context_usage().await?;
|
self.display_context_usage().await?;
|
||||||
|
|
||||||
|
|||||||
@@ -1252,6 +1252,8 @@ pub fn display_session_info(
|
|||||||
session_id: &Option<String>,
|
session_id: &Option<String>,
|
||||||
provider_instance: Option<&Arc<dyn goose::providers::base::Provider>>,
|
provider_instance: Option<&Arc<dyn goose::providers::base::Provider>>,
|
||||||
) {
|
) {
|
||||||
|
set_terminal_title();
|
||||||
|
|
||||||
let status = if resume {
|
let status = if resume {
|
||||||
"resuming"
|
"resuming"
|
||||||
} else if session_id.is_none() {
|
} else if session_id.is_none() {
|
||||||
@@ -1271,8 +1273,16 @@ pub fn display_session_info(
|
|||||||
model.to_string()
|
model.to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let cwd_display = std::env::current_dir()
|
||||||
|
.ok()
|
||||||
|
.map(|p| p.display().to_string())
|
||||||
|
.unwrap_or_else(|| "unknown".to_string());
|
||||||
|
|
||||||
|
// ASCII art goose with session info on the right
|
||||||
|
println!();
|
||||||
println!(
|
println!(
|
||||||
"\n {} {} {} {} {}",
|
" {} {} {} {} {} {}",
|
||||||
|
style(" __( O)>").white(),
|
||||||
style("●").green(),
|
style("●").green(),
|
||||||
style(status).dim(),
|
style(status).dim(),
|
||||||
style("·").dim(),
|
style("·").dim(),
|
||||||
@@ -1280,28 +1290,30 @@ pub fn display_session_info(
|
|||||||
style(&model_display).cyan(),
|
style(&model_display).cyan(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let cwd_display = std::env::current_dir()
|
|
||||||
.ok()
|
|
||||||
.map(|p| p.display().to_string())
|
|
||||||
.unwrap_or_else(|| "unknown".to_string());
|
|
||||||
|
|
||||||
if let Some(id) = session_id {
|
if let Some(id) = session_id {
|
||||||
println!(
|
println!(
|
||||||
" {} {} {}",
|
" {} {} {} {}",
|
||||||
|
style(r" \____)").white(),
|
||||||
style(" ").dim(),
|
style(" ").dim(),
|
||||||
style(id).dim(),
|
style(id).dim(),
|
||||||
style(format!("· {}", cwd_display)).dim(),
|
style(format!("· {}", cwd_display)).dim(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
println!(
|
println!(
|
||||||
" {} {}",
|
" {} {} {}",
|
||||||
|
style(r" \____)").white(),
|
||||||
style(" ").dim(),
|
style(" ").dim(),
|
||||||
style(format!(" {}", cwd_display)).dim(),
|
style(format!(" {}", cwd_display)).dim(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
println!(
|
||||||
|
" {} {}",
|
||||||
|
style(" L L").white(),
|
||||||
|
style(" goose is ready").white()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_terminal_title() {
|
fn set_terminal_title() {
|
||||||
if !std::io::stdout().is_terminal() {
|
if !std::io::stdout().is_terminal() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1316,15 +1328,6 @@ pub fn set_terminal_title() {
|
|||||||
let _ = std::io::stdout().flush();
|
let _ = std::io::stdout().flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn display_greeting() {
|
|
||||||
set_terminal_title();
|
|
||||||
println!(
|
|
||||||
"\n{} {}\n",
|
|
||||||
style("🪿 goose").bold(),
|
|
||||||
style("ready — type a message to get started").dim()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn display_context_usage(total_tokens: usize, context_limit: usize) {
|
pub fn display_context_usage(total_tokens: usize, context_limit: usize) {
|
||||||
use console::style;
|
use console::style;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user