dsh-remote-vs 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +40 -10
- package/README.md +31 -9
- package/lib/client.js +2616 -542
- package/lib/index.js +186 -40
- package/lib/types/client/CodeEditor.d.ts +17 -0
- package/lib/types/client/EditorPane.d.ts +16 -5
- package/lib/types/client/FloatingPlaceholder.d.ts +16 -5
- package/lib/types/client/RemoteEditorView.d.ts +13 -10
- package/lib/types/client/RemoteRoot.d.ts +5 -5
- package/lib/types/client/TerminalSnippets.d.ts +36 -0
- package/lib/types/client/TerminalView.d.ts +1 -1
- package/lib/types/client/XTerm.d.ts +33 -0
- package/lib/types/client/editor-capability.d.ts +27 -0
- package/lib/types/client/i18n.d.ts +1 -1
- package/lib/types/client/store.d.ts +59 -4
- package/lib/types/client/terminal-input.d.ts +23 -0
- package/lib/types/client/terminal-snippets.d.ts +86 -0
- package/lib/types/client/vsc/breadcrumb.d.ts +30 -0
- package/lib/types/client/vsc/editor-caret.d.ts +32 -0
- package/lib/types/client/vsc/editor-langs.d.ts +9 -0
- package/lib/types/client/vsc/editor-settings.d.ts +55 -0
- package/lib/types/client/vsc/image-preview.d.ts +36 -0
- package/lib/types/client/vsc/kit.d.ts +2 -0
- package/lib/types/client/vsc/terminal-clipboard.d.ts +15 -0
- package/lib/types/client/vsc/terminal-line.d.ts +25 -0
- package/lib/types/client/vsc/terminal-links.d.ts +62 -0
- package/lib/types/client/vsc/terminal-theme.d.ts +22 -0
- package/lib/types/client/vsc/terminal-writer.d.ts +52 -0
- package/lib/types/pool.d.ts +25 -0
- package/lib/types/terminal.d.ts +25 -1
- package/package.json +1 -1
- package/src/client/CodeEditor.tsx +54 -2
- package/src/client/EditorPane.tsx +485 -107
- package/src/client/FloatingPlaceholder.tsx +34 -5
- package/src/client/RemoteEditorView.tsx +14 -11
- package/src/client/RemoteRoot.tsx +20 -125
- package/src/client/TerminalSnippets.tsx +357 -0
- package/src/client/TerminalView.tsx +50 -1
- package/src/client/XTerm.tsx +228 -58
- package/src/client/auto-open-remote.ts +11 -9
- package/src/client/editor-capability.ts +42 -0
- package/src/client/i18n.ts +148 -6
- package/src/client/index.tsx +22 -6
- package/src/client/store.tsx +165 -13
- package/src/client/terminal-input.ts +44 -0
- package/src/client/terminal-snippets.ts +216 -0
- package/src/client/vsc/breadcrumb.tsx +251 -0
- package/src/client/vsc/editor-caret.ts +30 -0
- package/src/client/vsc/editor-langs.ts +20 -0
- package/src/client/vsc/editor-settings.ts +146 -0
- package/src/client/vsc/editor-theme.ts +4 -5
- package/src/client/vsc/image-preview.tsx +110 -0
- package/src/client/vsc/kit.tsx +20 -1
- package/src/client/vsc/terminal-clipboard.ts +19 -0
- package/src/client/vsc/terminal-line.ts +101 -0
- package/src/client/vsc/terminal-links.ts +166 -0
- package/src/client/vsc/terminal-theme.ts +71 -0
- package/src/client/vsc/terminal-writer.ts +112 -0
- package/src/client/vsc/vsc.css +687 -48
- package/src/pool.ts +99 -27
- package/src/terminal.ts +160 -6
package/README.en.md
CHANGED
|
@@ -8,10 +8,11 @@ SSH host management inside the DSH Host process + helper push pipeline + a **VS
|
|
|
8
8
|
workbench** (explorer / search / source control / commit graph with its commit-details pane / multi-tab editor / floating editor /
|
|
9
9
|
side-by-side diff / multiple terminals / port forwarding). Hosts live in DSH Settings ("Remote hosts"); with `dsh-better-sidebar` installed
|
|
10
10
|
there is an extra standalone "Remote Workspace" tab, otherwise it falls back to a native right-Sidebar "Remote Workspace"
|
|
11
|
-
page (same content, self-opened from the guide, per-session instances). The editor is
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
page (same content, self-opened from the guide, per-session instances). **The sidebar's editor is the DEFAULT
|
|
12
|
+
seat**: opening a file switches the whole column to it (one view at a time, no tree/editor split) and closing
|
|
13
|
+
the last file returns to the directory. The conversation view slot is registered too, but as the OPTIONAL
|
|
14
|
+
full-width seat — the editor's own expand/dock button moves the same buffer between the two. Since P2, native
|
|
15
|
+
tools inside remote workspaces transparently run remotely (see below).
|
|
15
16
|
|
|
16
17
|
```text
|
|
17
18
|
┌─ Local DSH Host ─────────────────────────┐
|
|
@@ -126,7 +127,7 @@ extra configuration is needed.
|
|
|
126
127
|
| Key bootstrap | One click generates a dedicated keypair on password hosts and deploys `authorized_keys`, key auth from then on |
|
|
127
128
|
| Push pipeline | Remote arch/OS probe → version compare → skip-if-same / else push; the executable channel pushes a self-built helper. A failed deploy no longer retries on every remote file operation: it backs off from **5 seconds up to 5 minutes**, and the Settings "Push" button forces an immediate retry; **an automatic push (first contact or upgrade self-heal) raises a bottom-right toast on success** (`alias: pushed remote helper <version>`), while a manual push stays quiet (Settings already shows its state) |
|
|
128
129
|
| Remote files | SFTP browse / read / write / create / delete / rename. Boundaries hardened: 0-byte files no longer deadlock, and every SFTP operation times out at 60s and releases its channel; **a single directory listing is capped at 20000 entries** (the first 20000 after sorting — directories first, then names — announced in the host log; the protocol carries no "truncated" field, so the UI has no marker); **a save goes through a side file and a rename** (server-side `posix-rename` when available, otherwise backup-rename-rollback), **writes through symlinks** (the link itself survives) and keeps the mode bits **on a best-effort basis**; SCM status parsing unquotes git's C-quoted paths (any name with whitespace is quoted) |
|
|
129
|
-
| Remote terminal | ssh2 PTY + WebSocket, xterm rendering (copy-paste/theme-follow/reconnect-on-refresh); **a reattach only takes over, it does not resize** (a page reload no longer shrinks a running shell to 80×24); an output backlog applies real backpressure to the far end; **frames are capped at 1 MiB**, and pastes past 64 Ki characters are chunked on code points by the client instead of dropping the connection |
|
|
130
|
+
| Remote terminal | ssh2 PTY + WebSocket, xterm rendering (copy-paste/theme-follow/reconnect-on-refresh; **the selection highlight is a visible blue in the light theme** — `#add6ff` light / `#264f78` dark, plus unfocused variants — no more white-on-white); `Shift+Insert` / `Ctrl+Shift+V` **paste exactly once** (xterm calls the key hook for keyup too, so the gesture used to run twice); **a reattach only takes over, it does not resize** (a page reload no longer shrinks a running shell to 80×24), and no resize frame is sent when rows/columns did not change; an output backlog applies real backpressure to the far end, and output within a short window is **coalesced into one frame** (flushed immediately past 64 KiB, and always before the exit frame) **Ctrl+click a path** reveals its folder in the directory tree (absolute / `~/` / relative tokens containing `/`, validated by stat in cwd → workspace-root → home order); a **"snippets" panel** next to the title stores name+command pairs, a click pastes into the command line **without Enter**, `Ctrl+B` adds one, and rows can be edited, deleted and dragged (Alt+Up/Down too), persisted in localStorage; echo after idle is flushed immediately, the client output path does not wait on xterm render callbacks, a closing socket releases its unsettled backpressure bytes, and the marks are 2 MiB / 512 KiB. so a busy command (`cat` of a large log, `dmesg`) costs far fewer frames and JSON parses; the terminal dials **its own SSH connection** per host (+1 connection, shared one as fallback) so bulk SFTP/git traffic no longer queues ahead of terminal I/O; **frames are capped at 1 MiB**, and pastes past 64 Ki characters are chunked on code points by the client instead of dropping the connection |
|
|
130
131
|
| Concurrent channels | At most **6** remote channels per host at a time (no longer colliding with the far end's sshd `MaxSessions`); the 7th queues for up to **30 seconds** and then fails with `remote host <alias> is busy` instead of piling on connections |
|
|
131
132
|
| Monitor | A sidebar **"Monitor"** page samples one host or every host **only while the panel and the page are visible**, at the configured refresh interval (5 s by default; 5/10/30 s in its settings): CPU, memory, disk, load, network rate, temperature and uptime, with 60-point history curves plus manual refresh and pause. The scope is "current host / a named host / all hosts" and survives a reload. The **first sample reports CPU% and the network rate as unknown** (both are deltas and need a second sample), and a non-Linux host shows unknown instead of 0. The Host caches one sample per alias for 3 seconds and joins concurrent requests, so one sample uses one exec channel and never the port-forward budget. Samples live in memory only — nothing is written to disk |
|
|
132
133
|
| Timeouts and process cleanup | Ordinary git commands default to 300 s (configurable); the **network verbs (fetch/pull/push/sync) default to 20 minutes with a 30-minute ceiling**. exec runs in its own session (`setsid --wait`); on timeout OR cancel it sends TERM and **escalates to KILL after 3 seconds**, reaping the child processes with it; a host without `setsid --wait` is detected by a one-shot probe and falls back to the old behaviour, with a host-log line saying the timed-out remote command may still be running; **directory / multi-selection archive downloads carry a 600 s server-side budget** (remote `timeout -k 3 600`; a host without GNU `timeout` falls back to the unbudgeted old behaviour) and fail with the real reason when it expires |
|
|
@@ -232,7 +233,7 @@ dsh_remote_vs/
|
|
|
232
233
|
├── vendor/dsh-remote-helpers/ # helper seeds (shipped, seeded into cache at startup, see below)
|
|
233
234
|
├── docs/ # local-only working docs (only docs/media/ screenshots ship)
|
|
234
235
|
│ ├── MAINTENANCE.md # local-only (.gitignore), not shipped: upgrade impact, checklist, pitfalls, release
|
|
235
|
-
│ ├── VERSION-HISTORY.md # local-only: per-release change log (0.7.1 → 0.
|
|
236
|
+
│ ├── VERSION-HISTORY.md # local-only: per-release change log (0.7.1 → 0.25.0)
|
|
236
237
|
│ └── GATES.md # local-only: local gate inventory and measured assertion counts
|
|
237
238
|
├── locale/ # bilingual plugin metadata
|
|
238
239
|
└── lib/ # build output (**must be committed**; only .map is ignored; restart after link install)
|
|
@@ -255,9 +256,25 @@ checking the build artifact). Both are covered under "Development".
|
|
|
255
256
|
|
|
256
257
|

|
|
257
258
|
|
|
258
|
-
Both surfaces share one state module (`store.tsx`): **the sidebar "Remote Workspace" page** (
|
|
259
|
-
`dsh-better-sidebar` is installed, otherwise the native right-Sidebar page
|
|
260
|
-
"remote editor" tab** (
|
|
259
|
+
Both surfaces share one state module (`store.tsx`): **the sidebar "Remote Workspace" editor page** (the default
|
|
260
|
+
seat — a standalone tab when `dsh-better-sidebar` is installed, otherwise the native right-Sidebar page; it owns
|
|
261
|
+
the whole column) and **the conversation-view "remote editor" tab** (the optional full-width seat next to
|
|
262
|
+
对话/轨迹). Only one of them is mounted at a time and the buffer, caret and scroll position are handed over
|
|
263
|
+
when the seat changes.
|
|
264
|
+
|
|
265
|
+
- **Editor chrome** (ported from the local sidebar plugin): an opaque VS Code Dark+/Light+ code surface
|
|
266
|
+
(`#1e1e1e` / `#ffffff`) with editor-panel tokens, a 30px tab strip (dirty dot, middle-click close, diff/image
|
|
267
|
+
glyphs), an info bar with reload / save / word-wrap / font A−A+ / float / seat switch, and — in the full-width
|
|
268
|
+
seat — a **clickable breadcrumb** (sibling-file picker over the remote listing route) plus a **status bar**
|
|
269
|
+
(language, line:column, selected characters, indent, wrap, font size, save state, UTF-8). Word wrap is one
|
|
270
|
+
shared preference persisted in localStorage (all seats); font size is shared by the docked and full-width
|
|
271
|
+
seats, while the floating window keeps its own per-window `Ctrl+wheel` zoom.
|
|
272
|
+
- **Image preview**: png/jpg/jpeg/gif/webp/bmp/ico/avif render in the tab with a click-to-toggle
|
|
273
|
+
fit/actual size and the file size plus pixel dimensions; a capped read says "image too large" instead of
|
|
274
|
+
drawing a broken thumbnail. SVG keeps opening as TEXT (editable) — it is markup, not a raster image.
|
|
275
|
+
- **Closing the last file returns to the directory**: the editor page hands the column back to the explorer
|
|
276
|
+
(a dirty tab still asks first). A diff tab carries one extra icon: **switch to content editing**, opening the
|
|
277
|
+
same path as an editable content tab (commit drill-downs, deletions and binary diffs do not offer it).
|
|
261
278
|
|
|
262
279
|
- **Activity rail**: explorer / search / source control / commit graph / editor / terminal / workspaces.
|
|
263
280
|
A panel stays mounted after its first visit, so switching back neither refetches nor flashes. While it is
|
|
@@ -277,6 +294,9 @@ Both surfaces share one state module (`store.tsx`): **the sidebar "Remote Worksp
|
|
|
277
294
|
- **Editor**: tabs plus an info bar (path, language, **build stamp**, `tok N` coloured-token count,
|
|
278
295
|
saved state, reload/save). Those three marks exist for troubleshooting: the stamp answers "is the
|
|
279
296
|
browser running the bundle I just built?", `tok 0` answers "did a grammar match this extension?".
|
|
297
|
+
A **diff tab** carries one extra icon next to "reload the diff": **switch to content editing**, which opens
|
|
298
|
+
the same path as an editable content tab (working-tree / staged diffs; commit drill-downs do not offer it —
|
|
299
|
+
opening today's file from a historical blob would read as editing the commit).
|
|
280
300
|
- **Floating editor**: "Open in floating editor" from the file-tree / search-hit / source-control context
|
|
281
301
|
menus, or double-click the "remote editor" tab, lifts the editor into a window above the shell (same tabs
|
|
282
302
|
and buffers; closing or docking puts it back on its original surface). Drag the title bar, resize from the
|
|
@@ -291,9 +311,19 @@ Both surfaces share one state module (`store.tsx`): **the sidebar "Remote Worksp
|
|
|
291
311
|
- **Terminals**: tabbed sessions with the session id persisted one by one, so a page refresh reattaches
|
|
292
312
|
to the shells that are still running; **a reattach only takes over, it does not resize** (a live shell is
|
|
293
313
|
never shrunk to 80×24 — the true size comes from the one tab that can measure itself, sent as a `resize`
|
|
294
|
-
frame
|
|
314
|
+
frame, and no frame is sent when rows/columns did not change); the selection highlight is **readable in
|
|
315
|
+
both themes** (`#add6ff` light / `#264f78` dark, with dimmer unfocused variants) and `Shift+Insert` /
|
|
316
|
+
`Ctrl+Shift+V` insert exactly once; output within a short window is coalesced into one frame (far fewer
|
|
317
|
+
frames and JSON parses for a busy command, always flushed before the exit frame); a session is kept for **10 minutes** after its last socket goes away before the remote shell is
|
|
295
318
|
closed (it used to be kept forever, so closing the browser left the shell holding an sshd session slot).
|
|
296
319
|
- **Known limits (stated honestly)**:
|
|
320
|
+
- **Occasional terminal hitches have three known sources**: (1) the PTY shares ONE SSH connection with SFTP / git / helper traffic — **now fixed for the PTY: it dials its own connection per host** (falling back to the shared one if the server refuses another), so bulk transfer no longer queues ahead of the terminal;
|
|
321
|
+
(2) while output is streaming, the echo of what you type is ordered after the output already produced
|
|
322
|
+
(that is every terminal; `Ctrl+C` still works because the input path is not blocked by output
|
|
323
|
+
backpressure); (3) heavy agent work blocking the host's event loop slows both directions. This round
|
|
324
|
+
fixed what is ours to fix: the client no longer waits on xterm's render callback, the host does not hold
|
|
325
|
+
a post-idle echo in the coalescing window, the backpressure marks are 2 MiB / 512 KiB, and a closing
|
|
326
|
+
socket releases its unsettled bytes. **The host-side part needs a `dsh web` restart.**
|
|
297
327
|
- There is **no public API to select the "remote editor" view**; the plugin can only click the shell's
|
|
298
328
|
own tab by its label and toasts a hint when that fails (`revealEditor()`).
|
|
299
329
|
- Untracked directories arrive as a **single `dir/` row**; clicking it **expands** the files inside
|
package/README.md
CHANGED
|
@@ -8,8 +8,9 @@ Host 进程内的 SSH 主机管理 + helper 推送流水线 + **VS Code 式远
|
|
|
8
8
|
(资源管理器 / 搜索 / 源代码管理 / 提交图与提交详情面板 / 多标签编辑器 / 悬浮编辑器 / 并排 Diff / 多终端 / 端口转发)。
|
|
9
9
|
主机配在 DSH 设置里(“远程主机”项);装了 `dsh-better-sidebar` 时另有
|
|
10
10
|
独立“远程工作台”tab,没装则退到原生右侧栏“远程工作台”页(同内容,引导页自助开,per-session 实例)。
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
**侧栏「远程工作台」的编辑器是默认面**:打开文件即整栏切到编辑器,关闭最后一个文件自动回到目录,
|
|
12
|
+
外观对齐本地侧边栏插件(VS Code 不透明代码背景、标签条、信息栏、图片预览、查找/换行/字号)。
|
|
13
|
+
会话视图槽里的**远程编辑器**标签是可选的全宽面 —— 信息栏的展开按钮切过去、收回按钮切回来,两个面共用同一份缓冲区。
|
|
13
14
|
P2 起原生工具在远端工作区里透明跑远端(见下)。
|
|
14
15
|
|
|
15
16
|
```text
|
|
@@ -108,7 +109,7 @@ Host 转发(终端按 `__DSH_TRANSPORT__.streamBaseUrl` 解析地址),无
|
|
|
108
109
|
| 密钥 bootstrap | 密码主机一键生成专用密钥对并下发 `authorized_keys`,之后走密钥 |
|
|
109
110
|
| 推送流水线 | 远端 arch/系统探测 → 版本比对 → 一致跳过 / 否则推送;executable 通道推送自编译 helper。失败后不再每次远端文件操作都重试:按 **5 秒起步、上限 5 分钟**的退避重试,设置页「推送」按钮可强制立即重试;**首次连接或协议自愈触发的自动推送成功后,右下角弹一条提示**(`alias:已自动推送远端 helper <版本>`),手动推送不弹(设置页已有状态) |
|
|
110
111
|
| 远端文件 | SFTP 浏览 / 读 / 写 / 新建 / 删除 / 改名。边界已加固:0 字节文件不再卡死,每个 SFTP 操作 60s 超时回收通道;**单个目录列表上限 20000 条**(按"目录在前、其余按名"排序后取前 20000,宿主日志说明——协议里没有"已截断"字段,界面上没有标记);**保存走侧文件 + 重命名**(优先服务端 `posix-rename`,不支持时备份-重命名-失败回滚),**写穿符号链接**(链接本身保留)并**尽力保留权限位**;SCM 状态解析会反解 git 的 C-quote 路径(凡名字含空格都会被加引号) |
|
|
111
|
-
| 远端终端 | ssh2 PTY + WebSocket,xterm
|
|
112
|
+
| 远端终端 | ssh2 PTY + WebSocket,xterm 渲染(复制粘贴/主题跟随/刷新重连;**亮色主题下的选中高亮是可见的蓝底**(亮 `#add6ff` / 暗 `#264f78` + 失焦变体),不再是白底白字);`Shift+Insert` / `Ctrl+Shift+V` **只粘贴一次**(xterm 的按键钩子对 keyup 也会回调,此前同一个手势被处理两遍);**重新挂接只接管、不改尺寸**(刷新页面不会把运行中的 shell 缩成 80×24),行列没变化时不再发 resize 帧;**Ctrl+点击路径**在目录树里定位到该目录(绝对路径/`~/`/带 `/` 的相对路径,先按 shell 上报的 cwd、再按工作区根、最后按 home 逐个 stat 验证;路径不在任何工作区内会明确提示);**「常用指令」**面板(标题旁按钮)保存「指令名 + 指令内容」,点一条只粘贴到命令行**不发送**,`Ctrl+B` 快速新增,支持编辑/删除/拖拽排序(Alt+↑↓ 亦可),存在浏览器 localStorage;输入输出方面:**echo 走即时通道**(空闲后的第一段输出不等合并窗口)、一个短窗口内的输出**合并成一帧**(缓冲超过 64 KiB 立即刷、退出帧前必刷)、客户端输出**不依赖 xterm 的渲染回调**(渲染被节流时不再堵住后续输出)、socket 断开时释放未结算的背压字节(否则通道会被永久暂停),背压高水位 2 MiB / 低水位 512 KiB(在"内存有界"与"echo 延迟有界"之间取更偏交互的一侧);**终端独占一条 SSH 连接**(每主机 +1 条,握手失败回落共享连接),SFTP/git 的大流量不再排在终端输入输出前面;**单帧上限 1 MiB**,超过 64 Ki 字符的粘贴在客户端按码点分块发送,不再撑断连接 |
|
|
112
113
|
| 并发通道 | 每主机同时最多 **6 条**远端通道(不再撞远端 sshd 的 `MaxSessions`);第 7 个排队最多等 **30 秒**,超时明确报 `remote host <alias> is busy`,而不是无限堆连接 |
|
|
113
114
|
| 运行监控 | 侧栏「监控」页:**仅在面板可见且页面在前台时**按刷新设置(默认 5 秒,可改 5/10/30 秒)采样一台/全部主机的 CPU、内存、磁盘、负载、网络速率、温度与运行时长,带 60 点历史曲线、手动刷新与暂停;范围可选「当前主机 / 指定主机 / 全部主机」并跨刷新记住。**首帧 CPU% 与网络速率显示「未知」**(差分需要第二帧),Linux 之外的平台如实显示「未知」而不是 0;Host 侧按 alias 缓存 3 秒并合并并发请求,一次采样只占一条执行通道、不占端口转发预算;样本只在内存,不落盘 |
|
|
114
115
|
| 超时与进程清理 | 普通 git 命令默认 300s(设置可调);**网络动词(fetch/pull/push/sync)默认 20 分钟、上限 30 分钟**。exec 跑在独立会话里(`setsid --wait`),超时/取消都先发 TERM、**3 秒后升级 KILL**,连同子进程一起收掉;远端没有 `setsid --wait` 时探测一次即知,退回旧行为并在宿主日志里写明"超时可能没停掉远端命令";**目录/多选归档下载有 600 秒服务端预算**(远端 `timeout -k 3 600`;远端没有 GNU `timeout` 时退回无预算的旧行为),超时以真实原因失败 |
|
|
@@ -214,7 +215,7 @@ dsh_remote_vs/
|
|
|
214
215
|
├── vendor/dsh-remote-helpers/ # helper 种子(随包发布,启动铺缓存,见下)
|
|
215
216
|
├── docs/ # 本地工作文档(不推送 GitHub;只有 docs/media/ 的截图随仓库公开)
|
|
216
217
|
│ ├── MAINTENANCE.md # 本地私有(.gitignore,不入库):升级影响面/检查清单/踩坑/发布流程
|
|
217
|
-
│ ├── VERSION-HISTORY.md # 本地私有:逐版本变更纪要(0.7.1 → 0.
|
|
218
|
+
│ ├── VERSION-HISTORY.md # 本地私有:逐版本变更纪要(0.7.1 → 0.25.0)
|
|
218
219
|
│ └── GATES.md # 本地私有:本地门禁清单与实跑条数
|
|
219
220
|
├── locale/ # 插件元信息双语
|
|
220
221
|
└── lib/ # 构建产物(**必须入库**,只有 .map 忽略;link 安装后重启即生效)
|
|
@@ -236,8 +237,9 @@ dsh_remote_vs/
|
|
|
236
237
|
|
|
237
238
|

|
|
238
239
|
|
|
239
|
-
两个挂载面共用一份状态(`store.tsx
|
|
240
|
-
|
|
240
|
+
两个挂载面共用一份状态(`store.tsx`):**右侧栏「远程工作台」的编辑器页**(默认面,装了 better-sidebar
|
|
241
|
+
走独立 tab,否则走原生右栏页;整栏显示,不与目录分栏)与**会话视图「远程编辑器」**(可选的全宽面,
|
|
242
|
+
与 对话/轨迹 并列)。同一时刻只挂载一个面,切换面时显式交接缓冲区与光标/滚动位置。
|
|
241
243
|
|
|
242
244
|
- **活动栏**:资源管理器 / 搜索 / 源代码管理 / 提交图 / 编辑器 / 终端 / 工作区;面板首次访问后
|
|
243
245
|
保持挂载,切回来不重新拉取、不闪。隐藏期间**不做远端工作**(目录列表、SCM 的 stash/分支/远程查询、
|
|
@@ -250,8 +252,18 @@ dsh_remote_vs/
|
|
|
250
252
|
手动刷新的结果一定晚于点击(排在后台读之后取最新结果),切走的读只写自己那份缓存、绝不上屏;后台读
|
|
251
253
|
失败保留原列表并显示原因,不会把工作区误判成"没有仓库"。刷新浏览器/重启 Host 后第一次切换仍要等
|
|
252
254
|
一次,这是有意的。
|
|
253
|
-
-
|
|
254
|
-
|
|
255
|
+
- **编辑器**:外观对齐本地侧边栏插件 —— VS Code Dark+/Light+ 的**不透明代码背景**(`#1e1e1e` / `#ffffff`)、
|
|
256
|
+
标签条(未保存圆点、中键关闭、diff/图片图标)、信息栏(路径、语言、**构建戳**、`tok N` 着色 token 数、
|
|
257
|
+
已保存状态、重载/保存/自动换行/字号 A−A+/悬浮/全宽切换)。会话区全宽面另带**可点面包屑**(同级文件下拉,
|
|
258
|
+
目录优先排序)与**状态栏**(语言、行:列、已选字符数、缩进、换行、字号、保存态、UTF-8)。
|
|
259
|
+
信息栏的构建戳与 `tok N` 是排障用的:构建戳判定"浏览器跑的是不是刚编的包",`tok 0` 判定语法包是否命中。
|
|
260
|
+
**diff 标签**的信息栏在「重新载入差异」旁多一个**切换为内容编辑**图标:一键把同一路径作为可编辑内容标签
|
|
261
|
+
打开(工作区/暂存 diff 有效;提交历史 drill-down 不显示——从历史 blob 打开"今天的文件"会被误读成编辑提交)。
|
|
262
|
+
自动换行与字号(含 `Ctrl+滚轮`)是跨面共享的本地偏好,**默认不换行**(与蓝本一致);悬浮窗内字号由浮窗
|
|
263
|
+
自身的缩放管理,所以 A−A+ 在浮窗里不显示。
|
|
264
|
+
- **图片预览**:png/jpg/jpeg/gif/webp/bmp/ico/avif 在编辑器里直接显示,点击切换「适应窗口 / 原始大小」,
|
|
265
|
+
并在下方给出大小与像素尺寸;读取被截断的图片明确提示过大而不是画一个破图。SVG 仍按文本打开(可编辑)。
|
|
266
|
+
- **关闭最后一个文件回到目录**:编辑器页没有打开的标签时自动切回资源管理器页;有未保存改动先确认。
|
|
255
267
|
- **悬浮编辑器**:文件树 / 搜索结果 / 源代码管理右键「在悬浮编辑器中打开」,或双击「远程编辑器」标签,
|
|
256
268
|
编辑器整体浮到页面最上层的窗口里(同一份标签与缓冲区,关闭/停靠后回原表面)。标题栏可拖动、八个边角
|
|
257
269
|
可缩放、可最大化/还原;**最小化成一个 44px 悬浮球**(不占整条标题栏,可拖到任意角落,单击/Enter 恢复,
|
|
@@ -260,9 +272,19 @@ dsh_remote_vs/
|
|
|
260
272
|
- **查找与跳转**:`Ctrl+F` 查找框固定右上角(`position: fixed` 锚定编辑器矩形,任何祖先滚动都不带走);
|
|
261
273
|
选中文本按 `Ctrl+F` 直接填入;从搜索结果跳转会**居中 + 落地行高亮**。
|
|
262
274
|
- **终端**:标签式多终端,session id 逐个持久化,刷新页面自动重连回原会话;**重连只接管、不改尺寸**
|
|
263
|
-
(活着的 shell 不会被缩成 80×24——真实尺寸由能测到自己的那个标签发 `resize`
|
|
275
|
+
(活着的 shell 不会被缩成 80×24——真实尺寸由能测到自己的那个标签发 `resize` 帧;行列没变不发帧);
|
|
276
|
+
选中高亮**明暗主题都可读**(亮 `#add6ff` / 暗 `#264f78`,失焦有更淡的变体),`Shift+Insert` /
|
|
277
|
+
`Ctrl+Shift+V` 只插入一次;一个短窗口内的输出合并成一帧(忙命令的帧数与 JSON 解析次数大幅下降,退出前必刷);
|
|
278
|
+
echo 不等合并窗口(空闲后的第一段输出立即发),客户端输出也不等 xterm 的渲染回调;
|
|
279
|
+
**Ctrl+点击路径**可在目录树里定位到对应目录;标题旁的**常用指令**面板支持新增/编辑/删除/拖拽排序,
|
|
280
|
+
点条目只粘贴不发送,`Ctrl+B` 快速新增;
|
|
281
|
+
socket 全断开后
|
|
264
282
|
会话保留 **10 分钟**,超时才关闭远端 shell(以前是永不回收,关掉浏览器后远端 shell 一直占着 sshd 会话槽)。
|
|
265
283
|
- **已知边界(诚实说明)**:
|
|
284
|
+
- **终端的偶发卡顿有三个已知来源**:① ~~同一条 SSH 连接被 SFTP/git/helper 大流量占满~~ —— 已改为**PTY 独占一条 SSH 连接**(每主机一条;被拒绝时回落到共享连接),SFTP/git 的大流量不再排在终端前面;② 正在刷屏时,输入的回显必须排在已产生的输出
|
|
285
|
+
之后(所有终端都如此,`Ctrl+C` 仍有效——输入路径不受输出背压影响);③ 宿主事件循环被 agent 的
|
|
286
|
+
重活占住时,终端的收发会一起变慢。本轮已把可控部分修掉:客户端不再等渲染回调、宿主 echo 不等
|
|
287
|
+
合并窗口、背压水位降到 2 MiB/512 KiB、socket 断开释放未结算字节。**宿主侧改动需重启 `dsh web`**。
|
|
266
288
|
- 切到「远程编辑器」标签**没有公开 API**,插件只能按标签文字点击外壳自己的 tab,失败时给 toast
|
|
267
289
|
提示手动切(`revealEditor()`);
|
|
268
290
|
- 未跟踪目录在状态里是**一行**(`dir/`),点它**展开**该目录里的文件(只发一条限定路径的
|