Code change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: code-cli insiders 1.81.0 (commit ) OS Version: Windows 10 21H2 .3086 I believe is only partially fixed, even in code-cli 1.81.0 (commit ). The window does not appear when only or code- (the cli) is running, however, as soon as a tunnel is connected to, a window appears (as code- is run). If the user closes the window, the tunnel connection is dropped. I believe the fix is to pass CREATENOWINDOW to creationflags in spawnserverprocess as seen here: However, without the proprietary "mixin" , it seems my builds of code cli are not able to properly run code-server, failing with [2023-06-28 19:09:25] info [rpc.3] Starting server... [2023-06-28 19:09:25] debug [rpc.3] Starting server with command... Command { std: "C:Usersredacted.vscode-insiderscliserversStable-serverbincode-" "--connection-token=redacted" "--accept-server-license-terms" "--start-server" "--enable-remote-auto-shutdown" "--socket-path=.pipecode-oss--ab53-485a-bc7d-", killon_drop: false } [2023-06-28 19:09:25] trace [rpc.3] [codeserver.13] The syntax of the command is incorrect. [2023-06-28 19:09:26] debug [tunnels::connections::ws] received liveness pong To reproduce the issue, on a windows machine: an arbitrary tunnel to authorize the machine: code- tunnel --name test the tunnel with the code at the tunnel service with code- service tunnel install that no is visable, and code- is running in the background connect to the tunnel again a appear on the desktop, close the and observe the tunnel disconnect on
Thanks for the issue. Please feel free to put in the PR, I can edit it if needed so that you get the credit for the fix :)
Confirming this fix is working in . On tunnel connect a does not appear.

Related discussion:
text: debug!(self.logger, "Starting server with command... {:?}", cmd); <ins> // On Windows spawning a code-server binary will run cmd.exe /c C:pathtocode-server.cmd... // This spawns a cmd.exe window for the user, which if they close will kill the code-server process // and disconnect the tunnel. To prevent this, pass the CREATE_NO_WINDOW flag to the Command // only on Windows. // Original issue: https://github.com/microsoft/vscode/issues/184058 // Partial fix: https://github.com/microsoft/vscode/pull/184621 #[cfg(target_os = "windows")] let cmd = cmd.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW); </ins> let child = cmd .stderr(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped())