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
Open
Conversation
5942298 to
4e7eb45
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for issue: #413
Title
fix(ssh): prevent visible ssh.exe console window on Windows and clean up processes on exitDescription
This PR resolves a Windows-specific bug where establishing an SSH tunnel spawned a visible command prompt/terminal window running
ssh.exethat 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.Command::new("ssh")calls in the system SSH builder and connection tester with a helper function that applies the Windows-onlyCREATE_NO_WINDOWcreation flag (fromstd::os::windows::process::CommandExt).2. Orphaned Process Cleanup
Spawning a
std::process::Childin Rust does not automatically terminate the child process when the parent exits or when theChildstruct is dropped.RunEvent::Exitlifecycle event insidelib.rsto invoke a newstop_all_tunnels()cleanup function on application exit, ensuring any active system SSH processes are forcefully terminated.How to Verify
1. visible console window fix
pnpm tauri buildand open the release binary directly from Windows Explorer).ssh.exewindow pops up on the screen.2. Orphaned process cleanup
tasklist | findstr sshin command prompt.ssh.exeprocess is terminated and no longer running.