dsh-quit-restart
lalalawang/dsh-quit-restart
在侧边栏加一行:一键退出 DeepSeek Harness Desktop 并重启。先结束 Electron 主进程和它拉起的宿主进程、等两个进程都消失后,再以无窗口方式重新启动应用,不会弹出控制台。接口只接受本机同源请求,且不从请求里读取进程号。仅支持 Windows。它的 HTTP 路由没有 DSH 的访问检查,浏览器里打开的网页可以调用它们。
安装
dsh plugin --profile web add github:lalalawang/dsh-quit-restartREADME
dsh-quit-restart
Adds one row to the DSH sidebar: Quit and restart DSH. Click it, the app closes and comes back on its own.
No tray menu, no hunting for the shortcut again.
Install
In the app: Plugins → Add plugin, then enter dsh-quit-restart (npm) or https://github.com/lalalawang/dsh-quit-restart.
Restart DSH once afterwards. Bundles are only scanned at startup.
Use
The last row of the sidebar, next to Settings. Click it: the button changes to "Quitting…", the page drops, the app starts again.
Nothing to configure.
What it actually does
On Windows it writes a one-off VBScript to %TEMP% and launches it with wscript.exe, detached, so no console window appears. The script does three things:
taskkillon two processes: the Electron main process and the host process this plugin runs inside. Killing only the main process is not enough: the host is its child, it keeps the port, and the new instance cannot start.- Polls every 250 ms to see if both PIDs are gone, for up to 10 s. If they are still there, it kills by image name.
- Clears the inherited
ELECTRON_RUN_AS_NODE(otherwise the new process starts as node and shows no window), then launches the original exe.
The script deletes itself when done.
Routes
| Route | Purpose |
|---|---|
GET /api/quit-restart/status | Resolved exe path, where it was found, main PID, whether the platform is supported |
POST /api/quit-restart/restart | {"dryRun": true} resolves only; otherwise restarts |
Both accept loopback requests only, and when an Origin header is present it must match the serving host, otherwise 403. Non-Windows returns 501.
If the exe path cannot be resolved
Normally it is derived from the parent process image, so nothing is hardcoded.
If that fails, set DSH_QUIT_RESTART_APP_EXE to the full path.
When something goes wrong
Logs land in %TEMP%\dsh-quit-restart-<pid>-<timestamp>.log, one line per stage.
A "Restart failed" button usually means the kill step was denied. Check the last line of the newest log.
Notes
- Restarting drops any in-flight generation. Session records are already on disk.
- The relaunched app is an independent process; closing the terminal you started DSH from does not affect it.
License
MIT