Preface¶
When developing or debugging using the DeepSeek Harness (DSH) desktop version, it is sometimes necessary to restart the application to clean up memory state or apply updates. The standard shutdown method may lead to residual processes or port occupation issues. The dsh-restart-hotkey plugin enables safe and smooth restarting of the application through a custom hotkey.
Plugin Introduction¶
dsh-restart-hotkey is a DSH desktop plugin developed by user hfbcwhy7gh-cpu. It aims to solve the cumbersome manual application restart process. With a single hotkey, it completely terminates processes and releases system handles/ports, then relaunches the application.
Core Features¶
The plugin mainly includes the following capabilities:
-
Safe, stable, and seamless application restart
The plugin completely terminates the original Electron main process and all resident child processes. After releasing system handles and port locks, it independently launches a newDeepSeek Harness.exethrough the Windows Shell, avoiding restart failures caused by parent-child process lifecycle locks. -
Application-specific scope
The hotkey is effective only when the DSH window has the active foreground focus. This avoids conflicts with other global system hotkeys or common software (such as VS Code, IDEA). -
Fully customizable hotkey support
The default hotkey isCtrl+Shift+R.- Dynamic recording: On the settings page, click “Record Key” and directly press a keyboard combination to automatically save it.
- Preset switching: Supports one-click switching among common presets (such as
Alt+R,F9,Ctrl+Alt+R).
-
Secondary confirmation dialog to prevent misoperation
When the hotkey is pressed, a confirmation dialog is displayed, providing “Confirm Restart” and “Cancel” options. The bottom of the dialog also provides an entry to “Change Hotkey” for immediate adjustment. It also supports checking “Next time restart directly without confirmation”. -
Multiple seamless settings entry points
Configuration options are not only embedded in DSH’s 【Settings】→【General】page, but also an independent settings card is provided, consistent with the plugin management ecosystem.
Installation and Enabling¶
Before installation, ensure the environment meets the requirements: Node.js version >= 20, DSH version >= 0.2.0-rc.2, and the current platform supports Windows.
Method 1: Directory Link Installation (Recommended for Development and Debugging)¶
- Clone or extract the project to a local directory.
- Open the DSH desktop version and click 「Plugins」 in the left sidebar.
- Select 「Install Plugin」, enter the absolute path of the project directory, and restart DSH.
Method 2: Packaged Installation (npm pack)¶
- Run the following command in the project root directory:
npm pack
- In the DSH desktop version 「Plugins」→「Install」, enter the path of the generated
.tgzpackage.
Typical Usage¶
After installation, go to DSH 【Settings】→【General】or 【Quick Restart】page.
- Basic Restart: With the DSH window active, press the default hotkey
Ctrl+Shift+Rand restart after confirming the dialog. - Record a New Hotkey: Click the “Record Key” button on the settings page, keep focus inside the DSH window, press a keyboard combination, and the system will automatically recognize and save it.
- Adjust Configuration: Directly click “Change Hotkey” at the bottom of the dialog, or adjust the “Secondary confirmation dialog before restart” option in the settings panel.
Use Cases and Notes¶
- Use cases: Development and debugging scenarios where the DSH application needs to be restarted frequently to reset state or clean up port occupation.
- Permissions and security: The plugin runs with DSH process permissions. Before installation, it is recommended to review the source code to ensure security. The project is open-sourced under the MIT license.
Summary¶
dsh-restart-hotkey encapsulates process management logic, providing the DSH desktop version with a quick operation experience similar to IDE hot reloading. It balances flexible key customization with operation safety, making it suitable for engineers who pursue an efficient development workflow.