dsh-wsl-tool 1.9.0 → 1.9.1
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.md +18 -22
- package/README.zh-CN.md +14 -19
- package/cordis.patch.yml +4 -32
- package/extras/terminal-wsl.patch.yml +34 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -134,13 +134,16 @@ A background job is owned by the calling session (`owner: exec.agent.id`), which
|
|
|
134
134
|
is what lets the model read it back with `job_output`/`job_kill` and what keeps
|
|
135
135
|
other sessions out; an execution with no agent starts the job unowned.
|
|
136
136
|
|
|
137
|
-
##
|
|
137
|
+
## Optional: a WSL terminal in the sidebar
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
The desktop app's sidebar terminal can open WSL instead of a Windows shell. It is
|
|
140
|
+
**opt-in** — installing this plugin does not change which shell your terminals
|
|
141
|
+
open — and the patch that enables it ships in the package as
|
|
142
|
+
[`extras/terminal-wsl.patch.yml`](extras/terminal-wsl.patch.yml).
|
|
143
|
+
|
|
144
|
+
To turn it on, copy that entry into your profile's own patch layer
|
|
145
|
+
(`$DSH_HOME/profiles/<profile>/cordis.patch.yml`); a CLI launch can instead pass
|
|
146
|
+
`--patch <path to the installed file>`. It applies at the next app start.
|
|
144
147
|
|
|
145
148
|
```yaml
|
|
146
149
|
- id: terminal-controller
|
|
@@ -151,26 +154,19 @@ next to them.
|
|
|
151
154
|
args: ['-e', 'bash', '-l']
|
|
152
155
|
```
|
|
153
156
|
|
|
157
|
+
- The sidebar's 新建终端 list is built from the composed `terminal-controller`
|
|
158
|
+
row: it lists the configured `shell` first and keeps the shells it discovers
|
|
159
|
+
(`powershell`, `cmd`, `bash`, …) selectable. The picker is core UI, so overriding
|
|
160
|
+
that row is the supported way in — which is also why this cannot be a plain
|
|
161
|
+
plugin entry.
|
|
154
162
|
- No distribution is pinned, so `wsl.exe` follows the system default — the same
|
|
155
|
-
rule the tools use when `DSH_WSL_DISTRO` is unset.
|
|
163
|
+
rule the tools use when `DSH_WSL_DISTRO` is unset. Add `-d <name>` to `args` to
|
|
164
|
+
pin one.
|
|
156
165
|
- The session workspace is a Windows path that `wsl.exe` translates, so the
|
|
157
166
|
terminal opens in `/mnt/<drive>/…` exactly like the Windows shells do; and it is
|
|
158
167
|
a real PTY (`xterm-256color`), so full-screen programs work.
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
```yaml
|
|
163
|
-
- id: terminal-controller
|
|
164
|
-
config:
|
|
165
|
-
shell:
|
|
166
|
-
path: 'C:\Windows\System32\wsl.exe'
|
|
167
|
-
name: WSL
|
|
168
|
-
args: ['-d', 'Ubuntu-22.04', '-e', 'bash', '-l']
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
An id-targeted patch replaces that row's whole config, so restate anything else
|
|
172
|
-
you had set on it.
|
|
173
|
-
- Applies at the next app start.
|
|
168
|
+
- An id-targeted patch replaces that row's whole config, so restate anything else
|
|
169
|
+
you had set on it (terminal limits, scrollback, a custom `shellCandidates` list).
|
|
174
170
|
|
|
175
171
|
## `wsl` parameters
|
|
176
172
|
|
package/README.zh-CN.md
CHANGED
|
@@ -116,11 +116,14 @@ DSH_SUBPROCESS_LOCAL=/path/to/dsh/node_modules npm run test:real
|
|
|
116
116
|
`job_output`/`job_kill` 读回它的依据,也是其他会话读不到它的围栏;exec 里没有 agent 时
|
|
117
117
|
任务则是无主的。
|
|
118
118
|
|
|
119
|
-
##
|
|
119
|
+
## 可选:在侧边栏开一个 WSL 终端
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
桌面版侧边栏终端可以开 WSL 而不是 Windows shell。这是**可选**的 —— 装插件**不会**改你终端默认
|
|
122
|
+
开什么 —— 启用用的 patch 随包提供:[`extras/terminal-wsl.patch.yml`](extras/terminal-wsl.patch.yml)。
|
|
123
|
+
|
|
124
|
+
启用方式:把里面的条目复制进你自己 profile 的 patch 层
|
|
125
|
+
(`$DSH_HOME/profiles/<profile>/cordis.patch.yml`);命令行启动也可以改成
|
|
126
|
+
`--patch <已安装文件路径>`。**下次启动应用时生效。**
|
|
124
127
|
|
|
125
128
|
```yaml
|
|
126
129
|
- id: terminal-controller
|
|
@@ -131,23 +134,15 @@ DSH_SUBPROCESS_LOCAL=/path/to/dsh/node_modules npm run test:real
|
|
|
131
134
|
args: ['-e', 'bash', '-l']
|
|
132
135
|
```
|
|
133
136
|
|
|
134
|
-
-
|
|
137
|
+
- 「新建终端」的列表来自组合里的 `terminal-controller` 行:它把配置的 `shell` 排在最前,同时保留
|
|
138
|
+
它发现的 `powershell`/`cmd`/`bash` 等可选。那个选择列表属于核心 UI,所以**按 id 覆盖该行**是
|
|
139
|
+
受支持的入口 —— 这也是它没法做成普通插件条目的原因。
|
|
140
|
+
- **不锁定发行版**:`wsl.exe` 跟随系统默认,与工具在未设 `DSH_WSL_DISTRO` 时的规则一致。要锁定就
|
|
141
|
+
在 `args` 里加 `-d <名字>`。
|
|
135
142
|
- 会话工作区是 Windows 路径,`wsl.exe` 会自动翻译,因此终端像 Windows shell 一样落在
|
|
136
143
|
`/mnt/<盘>/…`;而且是**真 PTY**(`xterm-256color`),全屏程序可用。
|
|
137
|
-
-
|
|
138
|
-
`
|
|
139
|
-
|
|
140
|
-
```yaml
|
|
141
|
-
- id: terminal-controller
|
|
142
|
-
config:
|
|
143
|
-
shell:
|
|
144
|
-
path: 'C:\Windows\System32\wsl.exe'
|
|
145
|
-
name: WSL
|
|
146
|
-
args: ['-d', 'Ubuntu-22.04', '-e', 'bash', '-l']
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
按 id 的 patch 会**整段替换**该行 config,其他设置要一并重述。
|
|
150
|
-
- **下次启动应用时生效。**
|
|
144
|
+
- 按 id 的 patch 会**整段替换**该行 config,你之前在该行上设过的东西(终端上限、scrollback、
|
|
145
|
+
自定义 `shellCandidates`)要一并重述。
|
|
151
146
|
|
|
152
147
|
## `wsl` 参数
|
|
153
148
|
|
package/cordis.patch.yml
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
# `tool "wsl" is already registered in this scope`. To keep the tools out of a
|
|
7
7
|
# composition, override this row by id in a later patch layer (`- id: tool-wsl`
|
|
8
8
|
# with `disabled: true`) instead of duplicating it.
|
|
9
|
+
#
|
|
10
|
+
# This file deliberately changes nothing else: installing a tool plugin must not
|
|
11
|
+
# reshape someone's session. Pointing the desktop app's sidebar terminal at WSL is
|
|
12
|
+
# offered as an opt-in instead — see `extras/terminal-wsl.patch.yml`.
|
|
9
13
|
|
|
10
14
|
# The entry name is PATH-RELATIVE on purpose. DSH anchors a relative `name:` to
|
|
11
15
|
# the directory of the patch file that declared it (`anchorInsertedPluginNames`),
|
|
@@ -19,35 +23,3 @@
|
|
|
19
23
|
- insert:
|
|
20
24
|
- id: tool-wsl
|
|
21
25
|
name: './index.js'
|
|
22
|
-
|
|
23
|
-
# ── Sidebar terminal: a WSL shell, listed first and selected by default ────────
|
|
24
|
-
#
|
|
25
|
-
# The desktop app's 新建终端 list is built from the composed `terminal-controller`
|
|
26
|
-
# row: it discovers shells from `shellCandidates` and puts the configured `shell`
|
|
27
|
-
# first. Overriding that row here is what makes installing this plugin also give
|
|
28
|
-
# you a Linux terminal in the sidebar. (A candidate entry cannot do it: a shell
|
|
29
|
-
# discovered by name gets `-i` appended, and `wsl.exe -i` is a hard error.)
|
|
30
|
-
#
|
|
31
|
-
# The path is absolute because the configured shell must resolve, and a shell that
|
|
32
|
-
# cannot resolve makes every new terminal fail rather than just this one: wsl.exe
|
|
33
|
-
# ships with Windows at a fixed location, so this resolves even where no
|
|
34
|
-
# distribution is installed yet.
|
|
35
|
-
#
|
|
36
|
-
# No distro is pinned, so `wsl.exe` follows the system default — the same rule the
|
|
37
|
-
# tools use when DSH_WSL_DISTRO is unset. Add `-d <name>` to `args` to pin one.
|
|
38
|
-
#
|
|
39
|
-
# This changes the default terminal shell, which is deliberate for a WSL plugin
|
|
40
|
-
# and reversible: a later patch layer wins, so restating the row in a profile's own
|
|
41
|
-
# cordis.patch.yml overrides it (and a profile that sets its own `shell` there is
|
|
42
|
-
# unaffected by this row).
|
|
43
|
-
#
|
|
44
|
-
# An id-targeted patch replaces the whole config, so anything the layer below set
|
|
45
|
-
# on this row (limits, scrollback, a custom shellCandidates list) falls back to its
|
|
46
|
-
# schema default. Only `shell` is set here on purpose. Never add `disabled:` here:
|
|
47
|
-
# that would switch off the terminal feature for the user instead of just this row.
|
|
48
|
-
- id: terminal-controller
|
|
49
|
-
config:
|
|
50
|
-
shell:
|
|
51
|
-
path: 'C:\Windows\System32\wsl.exe'
|
|
52
|
-
name: WSL
|
|
53
|
-
args: ['-e', 'bash', '-l']
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# OPTIONAL — give the desktop app's sidebar terminal a WSL shell.
|
|
2
|
+
#
|
|
3
|
+
# This is deliberately NOT part of the bundle patch: installing a tool plugin must
|
|
4
|
+
# not change which shell someone's terminals open by default. To opt in, copy the
|
|
5
|
+
# entry below into the profile's own patch layer
|
|
6
|
+
# (`$DSH_HOME/profiles/<profile>/cordis.patch.yml`), or hand this file to a CLI
|
|
7
|
+
# launch with `--patch <path to this file>`. It applies at the next app start.
|
|
8
|
+
#
|
|
9
|
+
# Why an id-targeted override: the sidebar's 新建终端 list is built from the
|
|
10
|
+
# composed `terminal-controller` row, which discovers shells from
|
|
11
|
+
# `shellCandidates` and lists the configured `shell` first. A candidate entry
|
|
12
|
+
# cannot do it — a shell found by name gets `-i` appended, and `wsl.exe -i` is a
|
|
13
|
+
# hard error. The picker itself is core UI, so a plugin cannot add an entry to it;
|
|
14
|
+
# overriding the row is the supported way in.
|
|
15
|
+
#
|
|
16
|
+
# The path is absolute because a configured shell that fails to resolve makes every
|
|
17
|
+
# new terminal fail, not just this one, and wsl.exe ships with Windows at a fixed
|
|
18
|
+
# location whether or not a distribution is installed yet.
|
|
19
|
+
#
|
|
20
|
+
# No distribution is pinned, so `wsl.exe` follows the system default — the same
|
|
21
|
+
# rule the tools use when `DSH_WSL_DISTRO` is unset. Add `-d <name>` to `args` to
|
|
22
|
+
# pin one.
|
|
23
|
+
#
|
|
24
|
+
# An id-targeted patch replaces that row's whole config, so anything a layer below
|
|
25
|
+
# set on it (terminal limits, scrollback, a custom `shellCandidates` list) falls
|
|
26
|
+
# back to its schema default; only `shell` is set here on purpose. Never add
|
|
27
|
+
# `disabled:` — that would switch the whole terminal feature off instead of
|
|
28
|
+
# adjusting it.
|
|
29
|
+
- id: terminal-controller
|
|
30
|
+
config:
|
|
31
|
+
shell:
|
|
32
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
33
|
+
name: WSL
|
|
34
|
+
args: ['-e', 'bash', '-l']
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-wsl-tool",
|
|
3
|
-
"version": "1.9.
|
|
4
|
-
"description": "Run Linux commands from Windows through WSL, essentially matching a native Linux DSH for command execution: background jobs, stdin, path translation, a destructive-command guard and a WSL capability report. WSL calls run below the DSH sandbox, and a project on a Windows drive keeps Windows filesystem semantics.",
|
|
3
|
+
"version": "1.9.1",
|
|
4
|
+
"description": "Run Linux commands from Windows through WSL, essentially matching a native Linux DSH for command execution: background jobs, stdin, path translation, a destructive-command guard and a WSL capability report. Optionally gives the desktop app's sidebar terminal a WSL shell. WSL calls run below the DSH sandbox, and a project on a Windows drive keeps Windows filesystem semantics.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"README.md",
|
|
31
31
|
"README.zh-CN.md",
|
|
32
32
|
"PUBLISHING.md",
|
|
33
|
+
"extras",
|
|
33
34
|
"screenshots.json",
|
|
34
35
|
"assets",
|
|
35
36
|
"LICENSE"
|