{"record":{"id":"43b59e11afb86128","repo":"spacedriveapp/spacedrive","slug":"failed-to-register-alt-space-global-shortcut","errorCode":null,"errorMessage":"failed to register Alt+Space global shortcut","messagePattern":"failed to register Alt\\+Space global shortcut","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/tauri/src-tauri/src/main.rs","lineNumber":1932,"sourceCode":"\ttracing_subscriber::registry()\n\t\t.with(\n\t\t\ttracing_subscriber::EnvFilter::try_from_default_env()\n\t\t\t\t.unwrap_or_else(|_| \"info,sd_core=debug\".into()),\n\t\t)\n\t\t.with(tracing_subscriber::fmt::layer())\n\t\t.init();\n\n\ttauri::Builder::default()\n\t\t.plugin(tauri_plugin_clipboard_manager::init())\n\t\t.plugin(tauri_plugin_dialog::init())\n\t\t.plugin(tauri_plugin_fs::init())\n\t\t.plugin(tauri_plugin_os::init())\n\t\t.plugin(tauri_plugin_shell::init())\n\t\t.plugin(tauri_plugin_updater::Builder::new().build())\n\t\t.plugin(\n\t\t\ttauri_plugin_global_shortcut::Builder::new()\n\t\t\t\t.with_shortcut(\"Alt+Space\")\n\t\t\t\t.expect(\"failed to register Alt+Space global shortcut\")\n\t\t\t\t.with_handler(|app, _shortcut, event| {\n\t\t\t\t\tif event.state() == ShortcutState::Pressed {\n\t\t\t\t\t\tif let Err(error) = windows::toggle_voice_overlay_internal(app.clone()) {\n\t\t\t\t\t\t\ttracing::warn!(\n\t\t\t\t\t\t\t\t?error,\n\t\t\t\t\t\t\t\t\"Failed to toggle voice overlay from global shortcut\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.build(),\n\t\t)\n\t\t.invoke_handler(tauri::generate_handler![\n\t\t\tapp_ready,\n\t\t\tget_daemon_socket,\n\t\t\tget_server_url,\n\t\t\tset_library_id,\n\t\t\tget_current_library_id,","sourceCodeStart":1914,"sourceCodeEnd":1950,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/apps/tauri/src-tauri/src/main.rs#L1914-L1950","documentation":"During builder setup the Tauri app parses and registers Alt+Space via tauri_plugin_global_shortcut's with_shortcut; the expect fires at startup if the accelerator cannot be turned into a Shortcut (parse failure) or the plugin rejects the builder call. OS-level registration conflicts with another application owning Alt+Space surface in the same plugin's setup path.","triggerScenarios":"Editing the accelerator string to a malformed value (\"Alt+\", \"AltSpace\"); a plugin version whose parser rejects the combination; another running Spacedrive instance (or launcher app like Raycast/PowerToys) already holding Alt+Space at registration time.","commonSituations":"Customizing the hotkey in a fork; running two instances during development; conflicts with system-wide launcher utilities.","solutions":["Keep the accelerator exactly \"Alt+Space\": the shipped string parses fine, so a panic here means a local edit","If customizing, use valid accelerator syntax (\"CmdOrCtrl+Shift+P\", \"Alt+Space\") and test parse with Shortcut::parse before wiring","Close other apps holding Alt+Space (launchers, a second Spacedrive) before launching","Align the tauri-plugin-global-shortcut version with the Tauri version in use"],"exampleFix":"// before: unconditional expect at builder time\n.with_shortcut(\"Alt+Space\").expect(\"failed to register Alt+Space global shortcut\")\n\n// after: validate the accelerator first, panic with a targeted message\nlet shortcut: Shortcut = \"Alt+Space\".parse()\n    .expect(\"'Alt+Space' must parse as a Shortcut; fix the accelerator string\");\n// pass `shortcut` to the builder API that accepts a Shortcut value","handlingStrategy":"validation","validationCode":"// Parse the accelerator before building the plugin; fail with a precise message\nlet shortcut: tauri_plugin_global_shortcut::Shortcut = \"Alt+Space\".parse()\n    .unwrap_or_else(|e| panic!(\"invalid accelerator 'Alt+Space': {e}\"));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep accelerator strings in constants covered by unit tests that call Shortcut::parse","Check for conflicting global-hotkey owners (launchers, second instances) before launch","Pin plugin versions compatible with your Tauri version"],"tags":["tauri","global-shortcut","startup","panic"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}