From 9ed69b03a0445f95ae2775316cdd2f9b6ba8f6f6 Mon Sep 17 00:00:00 2001 From: pyro Date: Wed, 19 Aug 2026 17:04:39 -0500 Subject: [PATCH] added a bit of breakup between the startup output and the prompt to select a config, also made the switch_config command clear the current_input so that it's not left over when you come back. --- src/funcs.rs | 3 +++ src/main.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/funcs.rs b/src/funcs.rs index 65c394f..2bd78cd 100644 --- a/src/funcs.rs +++ b/src/funcs.rs @@ -33,6 +33,7 @@ pub fn startup( app.main_tx = tx.clone(); if let Some(line) = state.config.get("alternate_configs") { let mut selections = HashMap::new(); + println!("\n"); line.split(",").into_iter().for_each(|line| { if let Some((name, path)) = line.split_once("|") { selections.insert(name.to_string(), path.to_string()); @@ -44,6 +45,7 @@ pub fn startup( state.config_file.display().to_string(), ); println!("default | {}", state.config_file.display()); + println!("\n"); let response = get_user_input("which config would you like to load?")?; if let Some(path) = selections.get(&response) { app.load_config(PathBuf::from(path), true)?; @@ -653,6 +655,7 @@ pub fn run_tui( } "switch_config" => { switch_config = true; + state.curent_intput.clear(); break; } command_name => { diff --git a/src/main.rs b/src/main.rs index 69eb179..85c176e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -141,7 +141,7 @@ async fn main() { ); exit(1); } - let (mut appstate) = AppState::new(); + let mut appstate = AppState::new(); let config_load = appstate.load_config(client_config_path.clone(), true); if config_load.is_err() { eprintln!("error loading config!"); @@ -153,8 +153,8 @@ async fn main() { }); let handles = Arc::new(Mutex::new(Vec::new())); let handles_clone = handles.clone(); - println!("entering tui..."); let primary_handle = spawn(move || { + println!("entering tui..."); let _ = startup(appstate, false, handles_clone); }); if let Ok(mut lock) = handles.lock() {