🐛 fix: run shortcut and desktop wizards after default config too
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

The shortcut/desktop setup was only offered when the user chose the
interactive wizard path; the default config path skipped them entirely.

Move both setup_shortcut_wizard and setup_desktop_integration_wizard
calls out of run_wizard and into ensure_config_exists so they always
run after the config file is written, regardless of the setup mode chosen.
This commit is contained in:
Cinco Euzebio 2026-03-01 21:37:14 -03:00
parent 2d7d49d548
commit 2abf7e77b4
4 changed files with 16 additions and 15 deletions

View File

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [0.9.1] - 2026-03-01
### Fixed
- Shortcut and desktop integration wizards are now offered regardless of whether the user chose the interactive wizard or the default config on first run; previously they were only offered in the wizard path
## [0.9.0] - 2026-03-01
### Added

2
Cargo.lock generated
View File

@ -857,7 +857,7 @@ dependencies = [
[[package]]
name = "tmuxido"
version = "0.9.0"
version = "0.9.1"
dependencies = [
"anyhow",
"clap",

View File

@ -1,6 +1,6 @@
[package]
name = "tmuxido"
version = "0.9.0"
version = "0.9.1"
edition = "2024"
[dev-dependencies]

View File

@ -107,6 +107,14 @@ impl Config {
Self::run_wizard(&config_path)?;
}
}
// Offer shortcut and desktop integration regardless of setup mode
if let Err(e) = crate::shortcut::setup_shortcut_wizard() {
eprintln!("Warning: shortcut setup failed: {}", e);
}
if let Err(e) = crate::shortcut::setup_desktop_integration_wizard() {
eprintln!("Warning: desktop integration failed: {}", e);
}
}
Ok(config_path)
@ -147,19 +155,7 @@ impl Config {
let toml_string = toml::to_string_pretty(&config).context("Failed to serialize config")?;
fs::write(config_path, toml_string)
.with_context(|| format!("Failed to write config file: {}", config_path.display()))?;
// Offer to set up a keyboard shortcut (best-effort, non-fatal)
if let Err(e) = crate::shortcut::setup_shortcut_wizard() {
eprintln!("Warning: shortcut setup failed: {}", e);
}
// Offer to install .desktop entry + icon (best-effort, non-fatal)
if let Err(e) = crate::shortcut::setup_desktop_integration_wizard() {
eprintln!("Warning: desktop integration failed: {}", e);
}
Ok(())
.with_context(|| format!("Failed to write config file: {}", config_path.display()))
}
fn prompt_for_paths() -> Result<Vec<String>> {