dsh-restart-hotkey: DSH Desktop Hotkey Restart Plugin

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:

  1. 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 new DeepSeek Harness.exe through the Windows Shell, avoiding restart failures caused by parent-child process lifecycle locks.

  2. 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).

  3. Fully customizable hotkey support
    The default hotkey is Ctrl+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).
  4. 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”.

  5. 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.

  1. Clone or extract the project to a local directory.
  2. Open the DSH desktop version and click 「Plugins」 in the left sidebar.
  3. Select 「Install Plugin」, enter the absolute path of the project directory, and restart DSH.

Method 2: Packaged Installation (npm pack)

  1. Run the following command in the project root directory:
    npm pack
  1. In the DSH desktop version 「Plugins」→「Install」, enter the path of the generated .tgz package.

Typical Usage

After installation, go to DSH 【Settings】→【General】or 【Quick Restart】page.

  1. Basic Restart: With the DSH window active, press the default hotkey Ctrl+Shift+R and restart after confirming the dialog.
  2. 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.
  3. 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.

Plugin Directory | GitHub Repository

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye