feat(main): enhance prompt formatting

This commit is contained in:
xeruf 2024-08-15 09:31:49 +03:00
parent 0253b00c61
commit c93b2f2d91
1 changed files with 4 additions and 7 deletions

View File

@ -304,13 +304,10 @@ async fn main() {
println!(); println!();
let tasks = selected_relay.as_ref().and_then(|url| relays.get(url)).unwrap_or(&local_tasks); let tasks = selected_relay.as_ref().and_then(|url| relays.get(url)).unwrap_or(&local_tasks);
print!( print!(
"{} {}) ", "{} {}{}) ",
selected_relay.as_ref().map_or("TEMP".to_string(), |url| url.to_string()).bright_black().italic(), selected_relay.as_ref().map_or("TEMP".to_string(), |url| url.to_string()).bright_black(),
format!( tasks.get_task_path(tasks.get_position()).bold(),
"{}{}", tasks.get_prompt_suffix().italic(),
tasks.get_task_path(tasks.get_position()),
tasks.get_prompt_suffix()
).bold()
); );
stdout().flush().unwrap(); stdout().flush().unwrap();
match lines.next() { match lines.next() {