Introduction¶
In the DSH Web GUI, debugging agents rarely yields a prompt that is perfect on the first try. To retrieve a prompt typed a few rounds ago, you have to scroll up the chat history, copy, and paste manually; after switching sessions or restarting, there is no history to scroll. The terminal has history, but the Web input box lacked a counterpart.
dsh_PromptRecall solves this problem: mimicking Codex’s interaction, press ↑/↓ in the session input box to browse historical prompts, and the history persists across sessions and restarts.
DSH’s philosophy is “Everything is a plugin,” and interaction enhancements like input history are also integrated in the form of a plugin. Below is an introduction in order of functionality, storage design, and installation steps.
What is this¶
dsh_PromptRecall is a DSH Web GUI input history plugin that mimics Codex, maintained by liguanyu, licensed under MIT, with package.json marking version 1.0.0. It is worth noting that the repository and README refer to dsh_PromptRecall, while the package name in package.json is dsh-prompt-recall; both refer to the same project, and the GitHub repository is the source of truth when verifying the source.
The problem it solves is specific: giving the session input box the ability of terminal history, and ensuring the history can still be recalled after page refreshes and process restarts.
Keys and Interaction¶
No extra configuration is needed after installation. Common keys are as follows:
| Key | Behavior |
|---|---|
↑ (Empty Draft) |
Enter history browsing, starting from the newest entry |
↑ / ↓ (Browsing) |
Move to older / newer; no wrapping at the oldest |
↓ (Press again on newest) |
Clear input box and exit browsing |
↑ / ↓ (Non-empty draft, body middle, selection, modal open) |
Return to editor, move cursor or candidates only |
Esc (Non-empty draft) |
Clear draft and save to history, retrievable via ↑ |
Esc (Browsing) |
Exit browsing; do nothing if draft is empty |
Here, “Empty Draft” refers to semantic emptiness: text, attachments, and mentions must all be empty; only then does pressing ↑ enter browsing.
The key takeover has clear boundaries: as long as the draft is non-empty, the cursor is stopped in the middle of a multi-line body, a selection exists, or a modal is open, the direction keys are returned to the editor to avoid interfering with the draft you are writing.
The Esc draft insurance is worth mentioning separately: if you write a long draft and decide to clear it to start over, Esc will save this text to history (text only), and you can retrieve it later by pressing ↑.
When browsing history, a position pill will appear above the input box, showing the current position, for example ↑ 2/38.
Current Conversation Priority¶
History is not a simple global timeline. When returning to a conversation, the plugin recalls that conversation’s history first; continuing to press ↑ enters the history of other conversations.
The README provides a reproducible order example: Session A inputs a, b, c in sequence, switches to Session B and inputs e, f, then switches back to A and presses ↑, the order is c → b → a → f → e. That is, current conversation priority with global history as a fallback.
Two-Layer History Design¶
History is divided into two layers:
- Persistent Layer: A JSONL file across sessions, storing only text;
- Local Layer: A recall list for the current session, including drafts paused by Esc.
Each record has a stable monotonic ID; trimming deletes the oldest whole line without re-numbering. Adjacent and identical entries in the local layer collapse into one, while the persistent layer retains duplicate records.
Data Storage and Capacity¶
History is written to prompt-history.jsonl under the DSH main directory (defaults to ~/.dsh/prompt-history.jsonl if DSH_HOME is not set), with one JSON record per line. Only plain text is saved; images, mention bindings, or other attachment content are not saved. The history directory is automatically created on first write; no manual preparation is required.
Capacity limits:
- The persistent file is approximately 10 MB; when the limit is exceeded, the oldest whole line is deleted, and the newest entry is always retained;
- The local recall list for the current session has a cap of 200 entries / 256 KB, evicting from the oldest.
To clear all history, click × on the position pill twice (within 3 seconds): the first click changes the button to “Confirm?”, the second executes the clear, including the persistent file.
Installation and Enablement¶
Prerequisites: A DSH environment with pnpm installed; dsh plugin forwards the installation action to pnpm.
To install from GitHub, execute:
dsh plugin --profile web add github:liguanyu/dsh_PromptRecall
This command installs the plugin into the web profile. If you want to modify the source code, use local installation:
git clone https://github.com/liguanyu/dsh_PromptRecall
cd dsh_PromptRecall
pnpm install # link installation resolves dependencies along the repository's real path; pnpm install must be run inside the repository first
dsh plugin --profile web add .
Local installation uses pnpm’s link: protocol; changes take effect after a restart without reinstalling. Since Node resolves the real path of the link, you must run pnpm install inside the repository once first to place runtime dependencies in place. The github: installation does not require this step; dependencies are installed into the profile tree with the package.
After the steps above, restart DSH Web to take effect:
dsh web
The plugin will become a line in the web combination, automatically loaded on startup without any manual define/run steps.
Suitable Scenarios and Notes¶
Suitable scenarios:
- Frequently iterating on long prompts in DSH Web and needing to retrieve previous versions;
- Parallel multi-session work, wishing each conversation prioritizes recalling its own history;
- Habit of writing and then clearing to rewrite, needing the Esc draft insurance as a fallback.
A few notes:
- The plugin runs with the permissions of the current dsh process and can read/write the history files under the DSH main directory. It is recommended to check the source code and license (this project is MIT) before installing to ensure it is correct.
- History only stores plain text, but both sent content and content paused by Esc are written to disk; if the prompt contains sensitive information, you can clear it anytime using
×on the pill. - History is shared across sessions; other sessions can reach the current session’s records by pressing
↑. If this is an issue, you need to clear the history manually.
Summary¶
dsh_PromptRecall brings the terminal history usage habits to DSH Web: one ↑ to retrieve the previous prompt, history persists across sessions and restarts, and key routing and trimming strategies have clear boundaries. If you debug prompts in the Web GUI daily, it is worth installing.
- GitHub: https://github.com/liguanyu/dsh_PromptRecall
- Directory: https://www.skillhub.cn/plugins/liguanyu/dsh_PromptRecall
It should be noted that the directory page above is a community site and has no official affiliation with DeepSeek or Huanfang.