返回目录
其他 插件

dsh-restart

XvBenny/dsh-restart

该仓库暂未提供项目说明。

Stars
0
Forks
0
Issues
0
更新
8 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:XvBenny/dsh-restart

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-restart

A DSH desktop plugin: one button in the conversation header restarts the whole app.

The button opens a confirmation dialog first. If any conversation is still working, the dialog lists them by title, together with the working directory and the session id, so you can see what the restart will interrupt before you agree to it.

How it works

  • The client half registers a 28×28 button in conversation.session.header.utilities and renders the dialog in its own root appended to document.body. The working list comes from the client session list snapshot (sessions.list.getSnapshot()), whose rows carry running — the same field the sidebar's spinner reads.
  • The host half exposes POST /dsh-restart/api/restart. The process about to die cannot restart itself, and a plain child process does not survive either: the desktop app runs in a job object, so a spawned helper is killed together with it. That is why the helper is started by a one-shot scheduled task (DSH-Restart-Helper) instead of as a child.
  • The task action is wscript.exe //B "launch.vbs", where the VBS calls sh.Run "<powershell> -File restart.ps1", 0, False. A task that launches powershell.exe directly still gets a console — Windows Terminal hosts it and <Hidden>true</Hidden> does not remove it — and the relaunched app inherits that console as its stdout, so the window outlives everything. wscript.exe is a GUI-subsystem binary and creates no console at all.
  • The PowerShell helper writes %TEMP%\dsh-restart.log, waits four seconds, kills the app by pid, then by image name, polls until no process is left, relaunches it through explorer.exe (the same path as double-clicking the executable, so nothing is inherited), retries once if the image is still missing after eight seconds, then deletes its scheduled task and its own temp directory.
  • POST /dsh-restart/api/restart answers only after the helper has written its first log line. If the helper never starts, the dialog shows the reason instead of claiming success.
  • GET /dsh-restart/api/info reports the platform and the resolved executable, useful when the app was launched from an unusual location.

Killing by image name rather than by process tree is deliberate: the helper is a task, not part of the app's tree, so every DSH process can go away while it keeps running.

The relaunched app opens its own window, usually on a new port. The old page stays stale and can be closed.

Install

dsh plugin --profile desktop add github:XvBenny/dsh-restart

Local checkout:

dsh plugin --profile desktop add file:C:/path/to/dsh-restart

Then restart DSH once so the plugin loads (the header button only appears after a restart — the plugin cannot restart itself into existence).

Requirements

  • Windows: the helper is a PowerShell script started through schtasks, wscript and taskkill.
  • A packaged desktop build: the relaunch target is process.execPath, and the plugin refuses to run if that is not an .exe.

Troubleshooting

  • The helper's own log is %TEMP%\dsh-restart.log; it records the kill, the relaunch and the cleanup, one line at a time.
  • If a run dies halfway, a task named DSH-Restart-Helper may be left behind. Remove it with schtasks /delete /tn "DSH-Restart-Helper" /f.
  • A relaunched app that inherits an open console dies when that console is closed. Keeping the relaunch on the explorer.exe path is what avoids it.

License

MIT

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类其他
规则置信度低

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。