Skip to content

fix(ssh): prevent visible ssh.exe console window on Windows and clean up processes on exit#418

Open
kennelken wants to merge 1 commit into
TabularisDB:mainfrom
kennelken:fix/windows-ssh-tunnel-console
Open

fix(ssh): prevent visible ssh.exe console window on Windows and clean up processes on exit#418
kennelken wants to merge 1 commit into
TabularisDB:mainfrom
kennelken:fix/windows-ssh-tunnel-console

Conversation

@kennelken

Copy link
Copy Markdown

Fix for issue: #413

Title

fix(ssh): prevent visible ssh.exe console window on Windows and clean up processes on exit

Description

This PR resolves a Windows-specific bug where establishing an SSH tunnel spawned a visible command prompt/terminal window running ssh.exe that remained running in the background even after Tabularis was closed.

1. Silent Process Spawning on Windows

On Windows, launching a console subsystem executable (like ssh.exe) from a GUI subsystem application (without a console) causes the OS to automatically allocate and open a new console window.

  • Fix: Replaced direct Command::new("ssh") calls in the system SSH builder and connection tester with a helper function that applies the Windows-only CREATE_NO_WINDOW creation flag (from std::os::windows::process::CommandExt).

2. Orphaned Process Cleanup

Spawning a std::process::Child in Rust does not automatically terminate the child process when the parent exits or when the Child struct is dropped.

  • Fix: Hooked into Tauri's RunEvent::Exit lifecycle event inside lib.rs to invoke a new stop_all_tunnels() cleanup function on application exit, ensuring any active system SSH processes are forcefully terminated.

How to Verify

1. visible console window fix

  1. Run a build/packaged application (or run pnpm tauri build and open the release binary directly from Windows Explorer).
  2. Create and connect to a database connection configured with an SSH tunnel.
  3. Verify: No command prompt or ssh.exe window pops up on the screen.

2. Orphaned process cleanup

  1. Open an SSH tunnel database connection in Tabularis.
  2. Close the Tabularis application.
  3. Open Task Manager or run tasklist | findstr ssh in command prompt.
  4. Verify: The spawned ssh.exe process is terminated and no longer running.

@kennelken kennelken force-pushed the fix/windows-ssh-tunnel-console branch from 5942298 to 4e7eb45 Compare July 2, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant