Returns the caret to the session composer on Ctrl+I; the key is rebindable in Settings and works from any region of the desktop window.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/Yaoxxxxxxx/dsh-plugins/releases/download/v1.1.0/dsh-focus-composer-1.1.0.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Yaoxxxxxxx/dsh-plugins#path:/packages/dsh-focus-composer
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
给 DSH 桌面端(DeepSeek Harness / @deepseek-ai/dsh-desktop)加一个 Ctrl+I 把光标送回输入框 的快捷键插件。
Cherry Studio 用惯了 Ctrl+I 聚焦输入框的人,换到 DSH 桌面端会不适应 —— 这个插件就是把那个手感搬过来。
A tiny DSH desktop plugin: press
Ctrl+Ito send the keyboard back to the session composer.
功能
- 窗口任意位置按
Ctrl+I→ 光标回到当前会话的输入框 - 输入框本来就有焦点时按 = 原地不动(幂等)
- 换会话也跟着走:切到哪个会话,按下去就聚焦哪个 —— 右侧栏开着别的会话也不会抢错
- 在终端面板 / 网页面板 / 各种输入框里按,同样生效(走桌面端原生键盘桥)
- 屏幕上没有输入框时(例如停在设置页)不吞键,按键照常传给别的处理器
- 命令已注册进官方快捷键目录:设置 → 快捷键 里能看到「聚焦输入框」,可以自己改键
自定义按键
两条路,按需要挑(不冲突:设置里存过的绑定永远优先于配置里的默认键)。
路子一:直接在设置里改(日常改键用这个)
设置 → 快捷键 → 搜「聚焦输入框」→ 点右边那个键位按钮 → 按下你想用的组合。
- 立即生效,不用改文件、不用重启
- 绑定存在本机设备上(Electron 的
userData/keybindings.json),插件更新/重装都不丢 - 想还原成默认:同一行的「重置」
路子二:在插件配置里改默认键(换机器/给别人预置用这个)
在 profile 的 cordis.patch.yml 里给这一行加 config:
- id: focus-composer
name: 'dsh-focus-composer'
config:
code: KeyI # 物理键代码(KeyboardEvent.code)
modifiers: [control] # control | alt | shift | meta | primary
改完刷新一次页面(Ctrl+R)生效。字段含义:
| 字段 | 说明 | 例子 |
|---|---|---|
code |
物理键,不是字符 | 字母 KeyI、数字 Digit1、功能键 F5、Slash、Backquote、Enter |
modifiers |
修饰键数组,primary = Windows 上的 Ctrl / macOS 上的 Command |
[control]、[control, alt]、[control, shift] |
- 填了不认识的值 → 自动退回
Ctrl+I(不会让插件挂掉,也不会静默绑到别的键上) - 官方桌面端允许:1
2 个普通键 + 04 个修饰键;Ctrl+I这种单修饰键组合在桌面端不受浏览器保留键限制 - 用户在设置里存过绑定的话,设置里的赢;这一项只是"没被改过时的默认值"
安装
方式一:市场 / 仓库地址安装(推荐)
在 DSH 的 插件市场 里填这串(本插件住在一个多插件仓库的子目录里,所以要带子目录选择器 —— pnpm 的 #path:):
github:Yaoxxxxxxx/dsh-plugins#path:/packages/dsh-focus-composer
装完刷新一次页面(Ctrl+R)即可生效 —— 带客户端半边的插件和官方口径一致。
方式二:本地 tarball
pnpm add ./dsh-focus-composer-<版本>.tgz --dir <你的 profile 目录>
然后把包名加进该 profile package.json 的 dsh.profile.bundles,重启桌面端。
环境要求
| 项 | 要求 |
|---|---|
| DSH | >= 0.1.7-rc.2(package.json 的 dsh.engines) |
| 平台 | Windows 桌面端(默认键只绑定 desktop:windows) |
| 依赖 | 无。只用宿主自带的官方服务 |
卸载
- 从 profile 的
package.json删除dependencies与dsh.profile.bundles里的dsh-focus-composer - 删除
node_modules/dsh-focus-composer - 重开桌面端
实现说明
为什么用官方快捷键服务,而不是自己监听 keydown
宿主自带 @deepseek-ai/dsh-client-shortcuts(服务名 shortcuts)。通过 ctx.shortcuts.register({...}) 注册的好处:
- 进官方快捷键目录 → 用户能改键、能看冲突
- Windows / macOS 桌面端会把目录推给原生键盘桥,所以不受焦点在终端 / webview / 弹窗影响
- 不用和别人的键位打架(注册时会做重复 id 与默认键冲突检查)
聚焦的两条路
lib/client.js 先试官方路径,再退到 DOM:
- 官方:
ctx.get("conversation").input.for(scope).focus()走宿主自己的 Lexical 编辑器,能恢复草稿上次的光标位置。scope取ctx.get("sessions").scope(id),id是会话列表里retainedBy.mainView > 0的那条(主视图独有,所以右侧栏的会话不会混淆)。 - 兜底:
document.querySelector("[data-composer-input]")(官方给 Lexical 根打的标记)→focus(),再把光标 collapse 到末尾。 为什么必须自己放光标:官方源码注释写明,裸 DOM focus 会把光标放到开头,那样接着打字会插到最前面。
两条路都包了 try/catch:任一失败只 console.warn 并放行按键,不会影响应用本身。
目录结构
dsh-focus-composer/
├── package.json # dsh.bundle.patch + dsh.client 双声明
├── cordis.patch.yml # 挂载行:insert id: focus-composer
├── lib/
│ ├── index.js # 宿主半边(空实现)
│ └── client.js # 客户端半边:注册快捷键 + 聚焦
└── README.md
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10669
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10669
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8366
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7489
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5362
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1070
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.