Introduction¶
The default behavior of the DeepSeek Harness (DSH) desktop client is as follows: clicking the close button in the top right corner hides the main window to the system tray, while the Harness-related processes continue to run in the background. For developers accustomed to the habit of “closing the window means ending the session,” it is easy to mistakenly believe the application has exited, while agents, terminal subprocesses, and background tasks are still running in the tray. Currently, there is no official toggle to change “Close” to “Quit Application.”
The community plugin dsh-ExitOnClose (maintainer xia0x1, npm package name dsh-exit-on-close) addresses this specific point: once installed, clicking “×” terminates the Electron shell and the entire DSH process tree, rather than just hiding the window. The following section describes its positioning, installation methods, and behavioral considerations during use.
What is this¶
dsh-ExitOnClose is a plugin for the DSH Desktop (Windows) client, categorized as a client capability enhancement. It does not register tools, slots, or routes, nor does it modify shared configurations. Mounted via a bundle patch, it listens for the “window transition from visible to invisible” event on Windows and triggers process termination.
Behavior comparison (from the project README):
Before Click × → Window hidden, tray icon remains, DSH continues running
After Click × → Window closed, all DSH processes terminated
Current version 0.1.0, License MIT. An entry can be found in the SkillHub Plugin Directory; for source code and documentation, see the GitHub Repository.
Core Features¶
- Close to Quit: The close button terminates the Electron shell and its process tree, including the host subprocess running the plugin; the window, tray icon, ongoing agent turns, background tasks, and terminal subprocesses all disappear.
- Zero Configuration: Takes effect immediately after installation and enabling; the README does not describe any additional configuration files or plugin page options.
- Windows Desktop Only: Relies on
@koromix/koffi-win32-x64for Win32-layer window visibility polling and process tree termination; it is not compatible with other platforms ordsh webin browsers. - Isolation: Does not declare
@deepseek-ai/dsh*peer dependencies, nor does it inject or consume DSH services;koffiis loaded lazily, and if loading fails, it only logs an error without affecting the startup of other plugins or profiles.
Installation and Activation¶
Graphical Interface¶
Open the Plugins page in the DSH Desktop client and paste the GitHub repository link:
https://github.com/xia0x1/dsh-ExitOnClose
Command Line¶
Execute in PowerShell (you can add a branch or tag after # to pin a version):
dsh plugin --profile desktop add https://github.com/xia0x1/dsh-ExitOnClose
dsh plugin --profile desktop add https://github.com/xia0x1/dsh-ExitOnClose#v0.1.0
For local development, the URL can be replaced with a local directory path.
Disable: Toggle off dsh-exit-on-close on the Plugins page.
Uninstall: Perform an uninstall for dsh-exit-on-close on the Plugins page.
The plugin runs with the permissions of the current DSH process; it is recommended to review the repository source code and MIT license before installation.
Typical Usage and Debugging¶
There are no additional steps for daily use: after enabling the plugin, simply click the window close button as usual.
If you wish to observe “what would be terminated upon closing” without actually killing processes, the README provides a safe mode: set the environment variable before starting the desktop client:
DSH_EXIT_ON_CLOSE_DRY_RUN=1
In this mode, the close button only logs the action and does not terminate processes.
Developers can run pure logic unit tests in the repository root directory (the README states these have zero dependencies):
node --test "test/*.test.mjs"
The repository also provides tools/dry-run.mjs as a manual probe, which only prints information and does not actually terminate anything.
Use Cases and Considerations¶
Who it is for
- Windows users of the DSH Desktop version who want the Harness to fully exit after closing the window and do not want it residing in the system tray.
- Scenarios requiring a clear distinction between “hiding the window” and “terminating all DSH processes.”
Important Notes
- Forceful Termination, Not Graceful Exit: Sessions, attachments, and logs already written to disk remain (DSH writes to disk while running); however, ongoing model output and running subprocesses will be lost.
- First Close: The official prompt “Tasks will continue, you can open from tray” may appear first; after confirming it once, it will not appear again (as per README behavior description).
- Version Compatibility: The author states in the README that it has been verified on DSH Desktop
0.2.0-rc.2/0.2.1-rc.2(Electron 44 / Node 24 / Windows x64); other versions are untested. - Ecosystem Note: The DSH community plugin directory (such as SkillHub) is an independent site and has no official affiliation with DeepSeek / High-Flyer; verifying sources and code before installing third-party plugins is standard practice.
Technical Overview (Optional Reading)¶
The desktop client is roughly divided into the Electron shell (handling the close button) and the host subprocess (running the plugin). The shell only accepts fixed IPC calls, so plugins cannot directly request it to quit; additionally, the close button is a native control, making it difficult to observe from within the page context. Therefore, the plugin uses koffi to poll the top-level window visibility approximately 4 times per second. It captures the transition from “once visible on screen” to “all invisible,” and then sequentially terminates the shell, its process tree, and itself. Polling is chosen over Win32 hooks to avoid holding hook state for long periods.
Conclusion¶
If your pain point is “DSH keeps running in the tray after clicking ×”, dsh-ExitOnClose changes the close button to a full application exit with minimal installation cost. If you accept the risk of unsaved output loss caused by forceful termination and are using the Windows desktop client, you can install it via the links above.
- Directory Page: https://www.skillhub.cn/plugins/xia0x1/dsh-ExitOnClose
- GitHub: https://github.com/xia0x1/dsh-ExitOnClose