dsh-plugin-wsl-env 0.17.0 → 0.18.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/CHANGELOG.md +73 -0
- package/README.md +2 -2
- package/cordis.patch.yml +10 -5
- package/docs/ARCHITECTURE.md +6 -5
- package/docs/COMPATIBILITY.md +1 -1
- package/docs/CONFIGURATION.md +23 -0
- package/docs/CONFIGURATION.zh.md +307 -0
- package/docs/LIMITATIONS.md +149 -336
- package/docs/LIMITATIONS.zh.md +177 -0
- package/docs/PEER-PARITY.md +77 -35
- package/docs/QUICKSTART.md +3 -1
- package/docs/QUICKSTART.zh.md +168 -0
- package/docs/README.zh.md +4 -3
- package/docs/RELEASING.md +2 -1
- package/docs/REQUIREMENTS.zh.md +8 -4
- package/docs/ROADMAP-1.0.md +14 -14
- package/docs/ROADMAP.md +10 -6
- package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +4 -1
- package/docs/UPSTREAM-FSIO-EXPORT.md +2 -2
- package/docs/UPSTREAM-SERVICE-SWAP.md +124 -0
- package/lib/fs-routing.d.ts +51 -1
- package/lib/fs-routing.js +55 -0
- package/lib/index.d.ts +50 -1
- package/lib/index.js +66 -8
- package/package.json +31 -26
package/docs/LIMITATIONS.md
CHANGED
|
@@ -1,377 +1,190 @@
|
|
|
1
1
|
# Limitations
|
|
2
2
|
|
|
3
|
+
*A Chinese translation lives at [LIMITATIONS.zh](LIMITATIONS.zh.md); the English version is authoritative.*
|
|
4
|
+
|
|
3
5
|
What the plugin does not do, and why. A limitation that is documented is a design
|
|
4
|
-
boundary; one that is not is a bug report waiting to happen.
|
|
6
|
+
boundary; one that is not is a bug report waiting to happen. Each entry states the
|
|
7
|
+
limit and the remedy; the reasoning lives in [ARCHITECTURE.md](ARCHITECTURE.md) and
|
|
8
|
+
the documents it links.
|
|
5
9
|
|
|
6
10
|
## The filesystem substrate (`wsl-fs`)
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- **
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
agent syncs the staged file before publication; the shell agent attempts
|
|
44
|
-
`sync -f` but ignores failure. Neither syncs the containing directory after
|
|
45
|
-
the rename or link. A kernel panic or power loss can therefore lose data or
|
|
46
|
-
the published directory entry; the operation is not a crash-consistent store.
|
|
47
|
-
- **A Linux filename containing a backslash cannot be addressed.** The UNC
|
|
48
|
-
display form (`\\wsl.localhost\<distro>\...`) is the file's identity
|
|
49
|
-
everywhere - the session header, the GUI, the caches - and the backslash is
|
|
50
|
-
the UNC's separator, so `a\b.ts` in the distro round-trips to `a/b.ts`: the
|
|
51
|
-
tools would silently address a different path. This is the coordinate
|
|
52
|
-
system's own limit — a backslash-delimited identity cannot spell a name
|
|
53
|
-
containing a backslash — not a defect of the substrate; a rename away from
|
|
54
|
-
backslash names is the workaround.
|
|
55
|
-
- **Stage two routes mutations through a confined resident.** A write or edit
|
|
56
|
-
under a confined policy runs on its own long-lived agent, spawned inside the
|
|
57
|
-
bwrap profile that binds exactly what the mode grants — so the kernel, not
|
|
58
|
-
just the host-side check, refuses a write outside the workspace, and the
|
|
59
|
-
refusal carries `FS_SANDBOX_DENIED` (the command path's dialect). Costs to
|
|
60
|
-
know: `bubblewrap` becomes required for confined writes (a distro without it
|
|
61
|
-
refuses them with the bootstrap command, rather than downgrading); a policy
|
|
62
|
-
change addresses a different resident, so the first write after switching the
|
|
63
|
-
Permissions selector pays one agent startup; and a write the policy grants to
|
|
64
|
-
the distro's `/tmp` lands in the distro's real `/tmp`, because the
|
|
65
|
-
file-writes resident binds it read-write — where the read tools, the plain
|
|
66
|
-
resident and the user's own shell all see it. The ephemeral tmpfs belongs to
|
|
67
|
-
the command side alone, so a file handed over from a command still goes
|
|
68
|
-
through the session workspace.
|
|
69
|
-
- **`glob` and `grep` run the distro's own rg** (`lib/search-route.js`): the
|
|
70
|
-
tool's arguments are forwarded verbatim, so results, output format and exit
|
|
71
|
-
codes are rg's own — at ext4 speed, with the distro's `.gitignore` rules.
|
|
72
|
-
A distro without rg fails the search outright: exit 127, with the message
|
|
73
|
-
from the exec launcher and never from rg itself (which is the missing
|
|
74
|
-
program) — `setsid: failed to execute rg: No such file or directory` where
|
|
75
|
-
the distro has `setsid`, the script shell's `rg: not found` where it does
|
|
76
|
-
not. The install command `scripts/bootstrap.sh` prints — `wsl.exe -d <distro>
|
|
77
|
-
-u root -- apt-get install -y bubblewrap git ripgrep inotify-tools`, or the
|
|
78
|
-
detected family's spelling — installs it. `--install` runs that command only
|
|
79
|
-
when `bubblewrap` itself is missing, so a distro that has bwrap but not rg
|
|
80
|
-
needs the printed line run by hand. A search whose directory is a Windows
|
|
81
|
-
folder keeps the host binary, which is native there.
|
|
82
|
-
- **`watch()` prefers inotify, with a polling fallback.** When `inotifywait`
|
|
83
|
-
is installed and the target is an unbounded directory, the watcher uses
|
|
84
|
-
recursive inotify watches and coalesces events to one callback per 0.5s.
|
|
85
|
-
Otherwise — a file target, a positive `maxDepth`, or no `inotify-tools` — it
|
|
86
|
-
is the `find -newer` poll loop (a `stat` fingerprint for a file), so the
|
|
87
|
-
coarse-invalidation caveats below apply.
|
|
88
|
-
- **With `sessionSandbox: false`, a confined command's `/tmp` is not the write
|
|
89
|
-
tool's `/tmp`.** `workspace-write` mounts a fresh tmpfs at `/tmp` for the
|
|
90
|
-
command — that is what makes it ephemeral — while the file tools' fence grants
|
|
91
|
-
the distro's *real* `/tmp`. Both are writable, so neither side is refused, but a
|
|
92
|
-
file the write tool puts in `/tmp` is invisible to `bash` and vice versa. Hand
|
|
93
|
-
a file between them through the session workspace. The shipped preset turns
|
|
94
|
-
the session runtime on, and `wsl-fs` shares it for confined writes, so
|
|
95
|
-
commands and writes bind the same real `/tmp` and workspace.
|
|
96
|
-
- A distro that is stopped or unregistered while the app runs takes the file
|
|
97
|
-
tools' substrate with it: reads and writes report the substrate-unavailable
|
|
98
|
-
error naming the cause. A death with nothing in flight costs nothing — the
|
|
99
|
-
next call starts a fresh transport, so a distro that comes back is served
|
|
100
|
-
again. A death with a request in flight spends the resident's one permitted
|
|
101
|
-
rebuild, and when that rebuild cannot complete — the distro is still down, or
|
|
102
|
-
gone — the resident is permanently out: every later file operation fails the
|
|
103
|
-
same way until the app restarts.
|
|
104
|
-
- `watch()` observes from inside the distro, so callbacks are coarse
|
|
105
|
-
invalidation, not per-file notifications. With inotify they arrive as events
|
|
106
|
-
(coalesced to 0.5s); with the polling fallback they arrive on the poll
|
|
107
|
-
cadence, not instantly. In the polling path a creation is seen even when the
|
|
108
|
-
new file's own mtime is old: creating it bumps the containing directory's
|
|
109
|
-
mtime, and the scan includes the watched directory itself (deletions are seen
|
|
110
|
-
the same way). What escapes the polling stamp is a change that leaves every
|
|
111
|
-
scanned mtime older than it — an in-place `cp -p` onto an existing file (new
|
|
112
|
-
content, a copied-back mtime), or a `tar -x` whose archive restores the
|
|
113
|
-
containing directory's own mtime. That blind spot does not apply to the
|
|
114
|
-
inotify path. A FILE target is watched by its `mtime:size` fingerprint: a
|
|
115
|
-
rename-over or an in-place write fires, a removal reports the target as gone,
|
|
116
|
-
and a change that preserves both mtime and size escapes it. Watching a 9p
|
|
117
|
-
share from the Windows side remains unsupported — the loop runs where the
|
|
118
|
-
kernel can actually report change.
|
|
12
|
+
One substrate: the resident in-distro agent (ext4 for distro files). The retired
|
|
13
|
+
Windows-side share backend (`substrate: "share"`) is refused at boot; WSL-routed
|
|
14
|
+
operations never use the 9p share.
|
|
15
|
+
|
|
16
|
+
- **A new file publishes with mode 0600.** Overwrites and edits keep the original
|
|
17
|
+
bits; `chmod` when a new file must be executable.
|
|
18
|
+
- **When the agent is out, file operations fail closed** — `FS_IO_ERROR` naming the
|
|
19
|
+
substrate, with the recovery path. One crash rides a single rebuild; a spent
|
|
20
|
+
rebuild enters bounded revival (2/4/8 s); three deaths are permanent until the app
|
|
21
|
+
restarts. There is no fallback I/O — deliberately.
|
|
22
|
+
- **The mutation guard is not atomic compare-and-swap.** Creates use a no-replace
|
|
23
|
+
link; overwrites re-verify the version before the rename. A mismatch returns
|
|
24
|
+
`FS_STALE_VERSION`, but a change between check and rename can still be overwritten.
|
|
25
|
+
- **A cancelled write can have an unknown outcome** — inspect the file before
|
|
26
|
+
retrying.
|
|
27
|
+
- **A successful write is not crash-durable.** The staged file is synced, the
|
|
28
|
+
containing directory is not: a power loss can lose the entry.
|
|
29
|
+
- **A Linux filename containing a backslash cannot be addressed** — the backslash is
|
|
30
|
+
the UNC separator, so `a\b.ts` round-trips to `a/b.ts`. Rename away from backslash
|
|
31
|
+
names; this is the coordinate system's own limit.
|
|
32
|
+
- **Confined writes run on their own bwrap-confined resident** — kernel-enforced,
|
|
33
|
+
refusing outside the workspace with `FS_SANDBOX_DENIED`. Costs: `bubblewrap`
|
|
34
|
+
required; a policy change pays one agent startup; a write granted to `/tmp` lands
|
|
35
|
+
in the distro's real `/tmp`.
|
|
36
|
+
- **`glob`/`grep` run the distro's rg**; a distro without rg fails the search
|
|
37
|
+
(exit 127). Install: `wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap
|
|
38
|
+
git ripgrep inotify-tools` (or the detected family's spelling). `--install` runs it
|
|
39
|
+
only for a missing `bubblewrap`.
|
|
40
|
+
- **`watch()` is coarse invalidation, not per-file notifications**: inotify events
|
|
41
|
+
coalesced to 0.5 s, or a `find -newer` poll loop otherwise. The polling path misses
|
|
42
|
+
an in-place `cp -p` or a `tar -x` that restores older mtimes; a FILE target watches
|
|
43
|
+
an `mtime:size` fingerprint. 9p watching from Windows stays unsupported.
|
|
44
|
+
- **With `sessionSandbox: false`, a confined command's `/tmp` differs from the write
|
|
45
|
+
tools' `/tmp`** — hand files over through the session workspace. The shipped
|
|
46
|
+
preset (`sessionSandbox: true`) shares one real `/tmp` and has no such split.
|
|
119
47
|
- `editText` reads the whole file into memory before writing it back.
|
|
48
|
+
- A distro that dies with a request in flight spends the resident's one rebuild;
|
|
49
|
+
still down, the resident stays out until the app restarts.
|
|
120
50
|
|
|
121
51
|
## The GUI workspace-files service
|
|
122
52
|
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
(
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
round trips instead of one, and a deep page read streams the preceding lines
|
|
133
|
-
through the pipe before cutting. Expect the GUI file tree and previews to be
|
|
134
|
-
slower than a direct agent call, especially on large files; the model's own
|
|
135
|
-
file operations are unaffected — they use the preset filesystem and the
|
|
136
|
-
resident agent directly. Measured 2026-10-19 with
|
|
137
|
-
[`test/probe/gui-preview.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/gui-preview.sh) (20 iterations on
|
|
138
|
-
this machine): the routed backend's `stat` p95 2.7 ms, `listDir` p95 5.1 ms,
|
|
139
|
-
and a 1 MiB `readByteRange` p95 **63.5 ms/MiB** — the service's own round
|
|
140
|
-
trips sit on top of those, and the 1 s/MiB budget has a wide margin. No
|
|
141
|
-
optimization is justified by these numbers; revisit only with a measured
|
|
142
|
-
regression.
|
|
143
|
-
|
|
144
|
-
- **`fs-routing` is the seam.** The shipped service depends on the routed root
|
|
145
|
-
filesystem staying enabled and faithful to the `ctx.fs` contract (`resolve`,
|
|
146
|
-
`lstat`, `stat`, `listDir`, `streamText`, `readBytes`, `watch`, `contains`,
|
|
147
|
-
`processPath`). Disabling `fs-routing` restores the host 9p-backed root
|
|
148
|
-
filesystem, and the GUI file service then crosses 9p for WSL workspaces. The
|
|
149
|
-
shipped row's own caps (`maxBytes`, `maxFileBytes`, `maxLines`, `maxEntries`)
|
|
150
|
-
can be overridden on the `workspace-files` row.
|
|
53
|
+
- The GUI file tree and previews use the shipped `workspace-files` row, reading WSL
|
|
54
|
+
paths through the routed root filesystem — deliberately not replaced (a server-only
|
|
55
|
+
takeover would drop the browser `file` provider the Sidebar previews need).
|
|
56
|
+
- **Expect extra round trips** (roughly 4-6 per listing/stat/page; measured p95:
|
|
57
|
+
`stat` 2.7 ms, `listDir` 5.1 ms, 1 MiB read 63.5 ms/MiB — 2026-10-19,
|
|
58
|
+
[probe](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/gui-preview.sh)).
|
|
59
|
+
The model's own file operations are unaffected.
|
|
60
|
+
- `fs-routing` is the seam: disabling it restores the host 9p-backed root filesystem.
|
|
61
|
+
The shipped row's caps can be overridden on the `workspace-files` row.
|
|
151
62
|
|
|
152
63
|
## `@` completion
|
|
153
64
|
|
|
154
|
-
- **`@` references
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
median over 9p versus **1.5 ms** on ext4 (~56×;
|
|
159
|
-
[`probe:file-reference`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/file-reference-9p.sh), 2026-10-19).
|
|
160
|
-
[`src/file-reference-wsl.ts`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/src/file-reference-wsl.ts) is the distro-side
|
|
161
|
-
traversal (built and unit-tested) but is **not** in `cordis.patch.yml`: the
|
|
162
|
-
funnels it would replace are module-internal. The fallback is the 9p walk
|
|
163
|
-
until upstream exposes `FileReferenceTraversal`. Cost, seam and wire
|
|
164
|
-
trigger: [UPSTREAM-FILE-REFERENCE-SEAM.md](UPSTREAM-FILE-REFERENCE-SEAM.md).
|
|
65
|
+
- **`@` references walk the 9p share** (~56× slower than ext4 on a probed tree,
|
|
66
|
+
2026-10-19). The distro-side traversal is built but not mounted — it needs the
|
|
67
|
+
upstream `FileReferenceTraversal` seam:
|
|
68
|
+
[UPSTREAM-FILE-REFERENCE-SEAM.md](UPSTREAM-FILE-REFERENCE-SEAM.md).
|
|
165
69
|
|
|
166
70
|
## The sandbox
|
|
167
71
|
|
|
168
|
-
- **The one-shot fallback has only the host deadline
|
|
169
|
-
|
|
170
|
-
`
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
agent
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
`wsl-shell` to keep the per-command shape. A **hard crash** of the app can
|
|
194
|
-
leave a stale `dsh-wsl-*.scope` and its background processes behind; a
|
|
195
|
-
graceful session end stops the scope (validated). The session preflight
|
|
196
|
-
sweeps stale scopes when the next WSL session opens: it stops a
|
|
197
|
-
`dsh-wsl-*.scope` only when its cgroup has no agent process (`wsl-agent.sh`
|
|
198
|
-
or the native `dsh-wsl-agent`), so another live session's runtime is never
|
|
199
|
-
touched.
|
|
200
|
-
- **The sandbox does not govern WSL interop.** A confined command can still run a
|
|
201
|
-
Windows program, which escapes the Linux-side boundary. The plugin reports this as
|
|
202
|
-
`enforcement: partial`. See [ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement).
|
|
203
|
-
The `maskWindowsDrive` key on `wsl-shell`, `wsl-fs` and `fs-routing` narrows the
|
|
204
|
-
hole: the confined profile shadows `/mnt` with an empty tmpfs, so files and
|
|
205
|
-
executables at paths under `/mnt` are hidden. Other mounts, alternate access
|
|
206
|
-
paths and unrestricted file reads are not covered by this mask. It is not a
|
|
207
|
-
closure — a command that can write the workspace can write an executable there and
|
|
208
|
-
run it (binfmt interop dispatches on file content, not location) — so enforcement
|
|
209
|
-
stays `partial`, the result's sandbox fact reports `windowsDrive: "masked"`, and
|
|
210
|
-
distro-level disabling of WSL interop (`[interop] enabled=false` in
|
|
211
|
-
`wsl.conf`) must be configured separately. On `wsl-shell`, an explicitly set
|
|
212
|
-
`interopVisibility` takes precedence over `maskWindowsDrive`.
|
|
213
|
-
- **`bubblewrap` must be installed**, or both providers fail immediately. The
|
|
214
|
-
usability probe re-runs after a failure, so installing bubblewrap while the app
|
|
215
|
-
runs is believed on the next command; only a success is cached. The refusal
|
|
216
|
-
classifies the probe's failure — missing versus present-but-failing — and the
|
|
217
|
-
direct install command follows the distro's package family; a probe failure
|
|
218
|
-
with no recognisable shape falls back to the install remedy with the raw
|
|
219
|
-
output quoted. A session-start preflight (`wsl-preflight`) surfaces the same
|
|
220
|
-
text as a warning; it is advisory and never installs.
|
|
221
|
-
- `workspace-write` binds the workspace root as writable, and bubblewrap refuses a
|
|
222
|
-
bind whose source directory does not exist, so a session whose workspace directory was
|
|
223
|
-
deleted fails with a runner error; the plugin does not recreate it. A workdir that
|
|
224
|
-
does not exist — a configured `cwd` pointing at a deleted directory, for instance — is
|
|
225
|
-
a separate case and is now reported as an error naming that directory, because
|
|
226
|
-
`wsl.exe` would otherwise run the command in `/` and exit 0.
|
|
72
|
+
- **The one-shot fallback has only the host deadline** — a killed `wsl.exe` does not
|
|
73
|
+
relay the kill into the distro, so the Linux process tree can outlive the call.
|
|
74
|
+
Prefer `agent: true` and the session runtime for long commands.
|
|
75
|
+
- **Batch reads share one native agent per distro** (16 concurrent calls in
|
|
76
|
+
2.4-4.1 ms; first call pays ~70 ms preparation).
|
|
77
|
+
- **aarch64 runs under qemu in CI only** (no Windows-on-ARM machine in reach —
|
|
78
|
+
[COMPATIBILITY.md](COMPATIBILITY.md#scope-decisions)). `auto` still selects the
|
|
79
|
+
packaged binary; `native` refuses on preparation failure; `shell` forces the shell
|
|
80
|
+
agent.
|
|
81
|
+
- **The session runtime needs systemd and a lingering user manager** — refused on the
|
|
82
|
+
first command with the remedy otherwise; `sessionSandbox: false` keeps the old
|
|
83
|
+
per-command shape. A hard app crash can leave a stale `dsh-wsl-*.scope`; the
|
|
84
|
+
preflight sweeps stale scopes on the next WSL session (never another live
|
|
85
|
+
session's).
|
|
86
|
+
- **The sandbox does not govern WSL interop** — reported as `enforcement: partial`.
|
|
87
|
+
`maskWindowsDrive` and `interopVisibility` narrow `/mnt` but are not a closure;
|
|
88
|
+
even `interopVisibility: "disabled"` only produces the `wsl.conf`
|
|
89
|
+
`[interop] enabled=false` remedy (printed by `doctor`) — the distro-level
|
|
90
|
+
setting must still be applied manually.
|
|
91
|
+
[ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement).
|
|
92
|
+
- **`bubblewrap` must be installed**, or both providers fail with the install
|
|
93
|
+
command; a session-start preflight surfaces the same text as an advisory warning.
|
|
94
|
+
- A workspace directory deleted mid-session fails with a runner error; the plugin
|
|
95
|
+
does not recreate it. A configured `cwd` that does not exist is reported as an
|
|
96
|
+
error naming the directory.
|
|
227
97
|
|
|
228
98
|
## Shell startup semantics (`wsl-shell`)
|
|
229
99
|
|
|
230
|
-
Commands run as `<shell> -lc <command>` —
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
commands. Non-interactivity is equally deliberate: interactive startup files
|
|
234
|
-
print prompts and plugin output into the streams the model reads, define
|
|
235
|
-
aliases that shadow real executables, and can keep the shell alive after the
|
|
236
|
-
command finishes. What follows from that split:
|
|
100
|
+
Commands run as `<shell> -lc <command>` — login (profile scripts sourced, so version
|
|
101
|
+
managers work) and **non-interactive** (no prompt/plugin output in the model's
|
|
102
|
+
streams). With `loginShell: false` the login flag is dropped (`<shell> -c <command>`).
|
|
237
103
|
|
|
238
|
-
- **`~/.zshrc`
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
(`eval "$(fnm env)"`, nvm, cargo) into `~/.zprofile` or `~/.zshenv`, which
|
|
245
|
-
login shells do read; keep prompt and completion plugins in `.zshrc`.
|
|
246
|
-
- **The confined sandbox mounts `/run` read-only, so fnm's multishell PATH
|
|
247
|
-
cannot form there.** `fnm env` works by creating a per-shell symlink
|
|
248
|
-
directory under `/run/user/<uid>/fnm_multishells/`; inside `bwrap` that
|
|
249
|
-
creation fails, and with it the PATH entry `fnm env` exists to provide.
|
|
250
|
-
A profile that must work in both worlds should fall back to fnm's stable
|
|
251
|
-
alias directory when the multishell link did not materialize — see the
|
|
252
|
-
recipe in [Configuration](CONFIGURATION.md#zshfnm-recipe-for-model-run-commands).
|
|
253
|
-
The plugin does not relax the sandbox for this: a writable `/run` inside the
|
|
254
|
-
fence would be a real weakening of it, traded for one tool's convenience.
|
|
104
|
+
- **`~/.zshrc` / `~/.bashrc` are never read.** Move machine-level PATH setup
|
|
105
|
+
(`fnm`, nvm, cargo) into `~/.zprofile` or `~/.zshenv`; keep prompts and completion
|
|
106
|
+
in the rc file.
|
|
107
|
+
- **fnm's multishell PATH cannot form inside the sandbox** (`/run` is read-only) —
|
|
108
|
+
use the fallback recipe in
|
|
109
|
+
[Configuration](CONFIGURATION.md#zshfnm-recipe-for-model-run-commands).
|
|
255
110
|
|
|
256
111
|
## Agent diagnostics
|
|
257
112
|
|
|
258
|
-
- **The doctor's `agent.handshake`
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
- **`dsh-wsl-*.scope` counts are point-in-time.** The doctor lists and inspects
|
|
266
|
-
the user scopes once; a scope created or stopped a moment later is not
|
|
267
|
-
reflected. `--fix` runs the same sweep the session preflight uses.
|
|
268
|
-
|
|
269
|
-
## The doctor's sessions table
|
|
270
|
-
|
|
271
|
-
- **The sessions table shows distro-side facts only.** The cross-distro view
|
|
272
|
-
(`distro → scope → state → resident pids`) attests what the distro can see:
|
|
273
|
-
which scopes exist and which pids inside them are agent processes. A
|
|
274
|
-
resident's idle countdown and its `lastError` live in the host process that
|
|
275
|
-
owns it — there is no IPC channel from a plugin script to the app, so the
|
|
276
|
-
table cannot show them (`WSL-313`'s upstream ask). The agent.handshake
|
|
277
|
-
check notes a live resident's presence when the scope survey sees one, and
|
|
278
|
-
says that its own probe starts a fresh one.
|
|
113
|
+
- **The doctor's `agent.handshake` probes a fresh resident**, not the live one —
|
|
114
|
+
a running resident's `lastError` stays in the app log (`WslAgent.status()` exposes
|
|
115
|
+
it in-process).
|
|
116
|
+
- **`dsh-wsl-*.scope` counts are point-in-time**; `--fix` runs the preflight's sweep.
|
|
117
|
+
- **The doctor's `git.win-safe` probe reports the Windows git trust through interop
|
|
118
|
+
`git.exe`** — the `safe.directory` whitelist that WSL change review needs when
|
|
119
|
+
Windows git is installed (see Terminals below).
|
|
279
120
|
|
|
280
121
|
## Session-start advisories
|
|
281
122
|
|
|
282
|
-
- **There is no session-UI notice seam in DSH 0.2.1.**
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
anything, never cancels the session and never changes the fail-closed
|
|
286
|
-
behavior of the first command. The finding goes to the host log
|
|
287
|
-
(`logger.warn`) and into the session's runtime context as a `wsl-preflight`
|
|
288
|
-
entry — model-visible on the next assembly — but the GUI today has no
|
|
289
|
-
toast/banner service a plugin can publish to. `pnpm run doctor` is the
|
|
290
|
-
deterministic human-facing check; the exact upstream ask is
|
|
123
|
+
- **There is no session-UI notice seam in DSH 0.2.1.** `wsl-preflight` failures go
|
|
124
|
+
to the host log and the session's runtime context (model-visible next assembly) —
|
|
125
|
+
advisory only, never installing or cancelling. The upstream ask:
|
|
291
126
|
[UPSTREAM-SESSION-NOTICE.md](UPSTREAM-SESSION-NOTICE.md).
|
|
292
127
|
- **The runtime-context entry is a repeated snapshot, not a dismissible
|
|
293
|
-
notification.**
|
|
294
|
-
it has no severity decoration and no dismiss control. Removing the
|
|
295
|
-
`wsl-preflight` row (or setting `sandbox: false` on it) silences the probe
|
|
296
|
-
entirely.
|
|
128
|
+
notification.** Removing the `wsl-preflight` row silences the probe entirely.
|
|
297
129
|
|
|
298
130
|
## Ports
|
|
299
131
|
|
|
300
|
-
- **The port poller keeps the resident agent permanently warm
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
while a distro's session is active the agent never idles out: one `wsl.exe`
|
|
304
|
-
and one in-distro agent process stay resident per active distro even with no
|
|
305
|
-
command in flight. The poller starts only for a distro a session actually
|
|
306
|
-
uses; raising `portsRefreshMs` past the agent's idle timeout restores idle
|
|
307
|
-
shutdown, at the cost of staler port facts.
|
|
132
|
+
- **The port poller keeps the resident agent permanently warm** per active distro
|
|
133
|
+
(refresh 10 s). Raising `portsRefreshMs` past the agent's idle timeout restores
|
|
134
|
+
idle shutdown, at the cost of staler port facts.
|
|
308
135
|
|
|
309
136
|
## The directory picker
|
|
310
137
|
|
|
311
|
-
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
walk the host used to pay per entry. Entries arrive NUL-separated, so a
|
|
315
|
-
directory name containing a newline lists as one exact row (WSL-306 retired
|
|
316
|
-
the `ls -1ALp` line parse that used to split such a name into two rows or
|
|
317
|
-
drop it).
|
|
138
|
+
- Distro levels list from inside the distro in one round trip (NUL-separated, so
|
|
139
|
+
newline-bearing directory names list exactly — WSL-306); a one-shot `wsl.exe --exec
|
|
140
|
+
find` when the resident is out.
|
|
318
141
|
|
|
319
142
|
## Terminals
|
|
320
143
|
|
|
321
|
-
- Terminal routing is per-session by workspace coordinates
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
- **
|
|
326
|
-
|
|
327
|
-
`
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
the
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
`
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
observation is a scan rather than shell cooperation. `terminalIdleReclaim:
|
|
362
|
-
false` on the `subprocess-wsl` row restores close-by-hand: the launch then
|
|
363
|
-
carries no `DSH_TERMINAL_ID` marker, and the handle keeps the shipped
|
|
364
|
-
`unknown` activity, which never accumulates idle.
|
|
365
|
-
- Windows-folder host terminals (the `powershell.exe` branch) keep the shipped
|
|
366
|
-
behaviour: `unknown` activity, no reclamation.
|
|
144
|
+
- Terminal routing is per-session by workspace coordinates: a WSL-folder session gets
|
|
145
|
+
the distro shell, a Windows-folder session gets `powershell.exe` in its own
|
|
146
|
+
directory. The shell MENU's default entry stays the configured profile; a
|
|
147
|
+
directory-less launch lands in the distro.
|
|
148
|
+
- **Windows git must trust the share** (`safe.directory`), or WSL workspaces'
|
|
149
|
+
changed-files cards silently disappear (the discovery call answers
|
|
150
|
+
`detected dubious ownership`). One-time remedy on Windows:
|
|
151
|
+
`git config --global --add safe.directory "//wsl.localhost/*"`, then restart the
|
|
152
|
+
app. Two alternatives: the doctor's `git.win-safe` probe reports the state, and a
|
|
153
|
+
machine **without** Windows git needs nothing — the provider routes discovery into
|
|
154
|
+
the distro and translates the output into UNC form.
|
|
155
|
+
- **Colon-separated multi-directory `GIT_*` values pass through untranslated.**
|
|
156
|
+
The git environment translation rewrites single Windows directory values; a
|
|
157
|
+
colon-separated list (no current caller sets one) is forwarded as-is.
|
|
158
|
+
- **A NEW tab's title reads `WSL`** whatever it runs — the controller titles from the
|
|
159
|
+
composition's profile before the provider rewrites the launch, and a plugin cannot
|
|
160
|
+
correct the default ([UPSTREAM-TERMINAL-TITLE.md](UPSTREAM-TERMINAL-TITLE.md)).
|
|
161
|
+
The menu ships host candidates (`powershell`, `cmd`): a manually selected shell is
|
|
162
|
+
titled after itself; double-click rename also works.
|
|
163
|
+
- **Distro terminals ARE reclaimed when idle** — the handle counts the marked
|
|
164
|
+
processes through the resident agent (exactly one at its prompt = `idle`; a nested
|
|
165
|
+
shell or an `ssh-agent` from startup files reads `busy` by design). Threshold: the
|
|
166
|
+
controller's `unattendedTimeoutMs` (2 h). `terminalIdleReclaim: false` restores
|
|
167
|
+
close-by-hand. Windows-folder host terminals keep the shipped no-reclamation
|
|
168
|
+
behaviour.
|
|
169
|
+
|
|
170
|
+
## Enabling the plugin on a running profile
|
|
171
|
+
|
|
172
|
+
- **A GUI enable of this bundle can fail on a busy profile, and a restart
|
|
173
|
+
applies it.** The three root-plane takeovers (`subprocess`, `fs`,
|
|
174
|
+
`directoryPicker`) replace shipped services under the same names. On
|
|
175
|
+
app `0.2.2-rc.1` (cordis 4.1.0), a disposing provider keeps its service
|
|
176
|
+
registration until every dependent releases, so the replacements
|
|
177
|
+
collide with the shipped providers while sessions are live and the
|
|
178
|
+
enable reports them as failed. The selection is persisted either way;
|
|
179
|
+
**restarting the app loads the plugin** (the cold composition is
|
|
180
|
+
correct). Closing sessions before enabling usually lets the hot path
|
|
181
|
+
succeed — with no dependents the shipped providers release inside the
|
|
182
|
+
recomposition. Mechanism and repro:
|
|
183
|
+
[UPSTREAM-SERVICE-SWAP.md](UPSTREAM-SERVICE-SWAP.md).
|
|
367
184
|
|
|
368
185
|
## Host "Open in app"
|
|
369
186
|
|
|
370
|
-
- **Opening VS Code
|
|
371
|
-
|
|
372
|
-
`
|
|
373
|
-
`Code.exe` starts as Node, exits 1, and the UI reports launch-failed. File
|
|
374
|
-
Explorer and other non-Electron launchers are unaffected; the failure is the
|
|
375
|
-
same on a Windows folder and on a WSL UNC workspace. This repository does
|
|
376
|
-
not own that spawn path. The record and the upstream fix are in
|
|
187
|
+
- **Opening VS Code from "Open in app" can fail independently of this plugin** — the
|
|
188
|
+
Host runs with `ELECTRON_RUN_AS_NODE=1`, which the launcher inherits, so
|
|
189
|
+
`Code.exe` starts as Node and exits 1. Not owned by this repository:
|
|
377
190
|
[UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md).
|