refactor(io): set up file association once, not on every launch (#205)

Drop the every-launch (re)registration thread. File association is now set up
once via the first-launch prompt (Yes → register + set default; No → decline,
persisted as file_assoc_enabled) and managed afterwards by the FILEASSOC
command. set_default_app now registers the handler entries (.desktop / mime /
ProgIDs) itself before asking the OS to default to us, since boot no longer
does — so the default never points at a missing handler.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-29 13:06:33 +03:00
commit 54186309b2
3 changed files with 11 additions and 16 deletions

View file

@ -96,6 +96,10 @@ pub async fn set_default_app() -> Result<String, String> {
}
fn set_default_app_blocking() -> Result<String, String> {
// Boot no longer auto-registers, so make sure the handler entries (the
// .desktop / mime package / ProgIDs) exist before asking the OS to default
// to us — otherwise the default would point at nothing.
register_as_handler()?;
#[cfg(target_os = "windows")]
{
windows_impl::set_default()