spacedriveapp/spacedrive · error

failed to register Alt+Space global shortcut

Error message

failed to register Alt+Space global shortcut

What it means

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.

Source

Thrown at apps/tauri/src-tauri/src/main.rs:1932

	tracing_subscriber::registry()
		.with(
			tracing_subscriber::EnvFilter::try_from_default_env()
				.unwrap_or_else(|_| "info,sd_core=debug".into()),
		)
		.with(tracing_subscriber::fmt::layer())
		.init();

	tauri::Builder::default()
		.plugin(tauri_plugin_clipboard_manager::init())
		.plugin(tauri_plugin_dialog::init())
		.plugin(tauri_plugin_fs::init())
		.plugin(tauri_plugin_os::init())
		.plugin(tauri_plugin_shell::init())
		.plugin(tauri_plugin_updater::Builder::new().build())
		.plugin(
			tauri_plugin_global_shortcut::Builder::new()
				.with_shortcut("Alt+Space")
				.expect("failed to register Alt+Space global shortcut")
				.with_handler(|app, _shortcut, event| {
					if event.state() == ShortcutState::Pressed {
						if let Err(error) = windows::toggle_voice_overlay_internal(app.clone()) {
							tracing::warn!(
								?error,
								"Failed to toggle voice overlay from global shortcut"
							);
						}
					}
				})
				.build(),
		)
		.invoke_handler(tauri::generate_handler![
			app_ready,
			get_daemon_socket,
			get_server_url,
			set_library_id,
			get_current_library_id,

View on GitHub (pinned to 6dfeccf211)

Solutions

  1. Keep the accelerator exactly "Alt+Space": the shipped string parses fine, so a panic here means a local edit
  2. If customizing, use valid accelerator syntax ("CmdOrCtrl+Shift+P", "Alt+Space") and test parse with Shortcut::parse before wiring
  3. Close other apps holding Alt+Space (launchers, a second Spacedrive) before launching
  4. Align the tauri-plugin-global-shortcut version with the Tauri version in use

Example fix

// before: unconditional expect at builder time
.with_shortcut("Alt+Space").expect("failed to register Alt+Space global shortcut")

// after: validate the accelerator first, panic with a targeted message
let shortcut: Shortcut = "Alt+Space".parse()
    .expect("'Alt+Space' must parse as a Shortcut; fix the accelerator string");
// pass `shortcut` to the builder API that accepts a Shortcut value
Defensive patterns

Strategy: validation

Validate before calling

// Parse the accelerator before building the plugin; fail with a precise message
let shortcut: tauri_plugin_global_shortcut::Shortcut = "Alt+Space".parse()
    .unwrap_or_else(|e| panic!("invalid accelerator 'Alt+Space': {e}"));

Prevention

When it happens

Trigger: 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.

Common situations: Customizing the hotkey in a fork; running two instances during development; conflicts with system-wide launcher utilities.

Related errors


AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16). Data as JSON: /api/errors/43b59e11afb86128. Report an issue: GitHub.