dsh-gitbash-shell 0.24.3 → 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.md CHANGED
@@ -85,15 +85,22 @@ bundle patch(`cordis.patch.yml`)应用三个改动:
85
85
 
86
86
  ## 配置
87
87
 
88
- `gitbash-presets` 行支持 `presets` 数组,只物化你常用的模式(未列出的旧物化目录、
89
- 且未被用户修改过的,会自动清理):
88
+ `gitbash-shell` 行(行 id 自 v0.24.0 起与设置命名空间同串;≤ v0.23.0 为 `gitbash-presets`)
89
+ 支持 `presets` 数组,只物化你常用的模式(未列出的旧物化目录、且未被用户修改过的,会自动清理):
90
90
 
91
91
  ```yaml
92
- - id: gitbash-presets
92
+ - id: gitbash-shell
93
93
  config:
94
94
  presets: [standard-gitbash, minimal-gitbash] # 默认物化全部 4 个
95
+ suppressPeerCordis: false # 与 dsh-ptc-cordis-preset 去重,默认关
95
96
  ```
96
97
 
98
+ 去重开关 `suppressPeerCordis`(布尔,**默认 `false`**)只在两个事实**同时**成立时才把
99
+ `创造模式 · Git Bash`(`cordis-gitbash`)从名录里摘掉:开关为 `true` **且**
100
+ dsh-ptc-cordis-preset 报告它的 `PTC 创造模式` 已经是 Git Bash 版。默认关 ⇒ 名录与
101
+ 0.24.x 的四个变体逐字不变;判定细节、生效时机与两侧同步方式见下方
102
+ [「与 dsh-ptc-cordis-preset 联动」](#与-dsh-ptc-cordis-preset-联动)。
103
+
97
104
  配合 `agent-presets` 的 `default`,新会话直接落在 Git Bash 模式,免去每次在
98
105
  模式选择器里翻找(原版 shipped 模式无法替换或隐藏——部署级、只读):
99
106
 
@@ -144,6 +151,42 @@ preset 会被插件自动清理;宿主 shell 回退为 PowerShell。
144
151
  > 切换生效后若 `ptc-cordis` 目录已存在且被旧版本物化,删除
145
152
  > `~/.dsh/.agent-presets/ptc-cordis` 并重启,即由新逻辑重新物化。
146
153
 
154
+ ### 去重开关:`suppressPeerCordis`(默认关,v0.25.0)
155
+
156
+ 联动生效后,`创造模式 · Git Bash`(本插件的 `cordis-gitbash`)与对方已经 Git Bash 化的
157
+ `PTC 创造模式` 面向的是同一件事,而两插件同装时它们默认**并列出现**。把本插件行 Config 上的
158
+ `suppressPeerCordis` 打开,本插件才会把自己的那个变体摘掉(需求与取舍见
159
+ [issue #7](https://github.com/KannaKuron/dsh-gitbash-shell/issues/7))。
160
+
161
+ **判定 = 两个事实同时成立,缺一不可**:
162
+
163
+ - 开关为 `true`;
164
+ - 且对方通过 host 能力服务 `ptcCordisPreset` 报告 `gitBashActive: true`(即它的
165
+ `PTC 创造模式` 确实按 Git Bash 版生效)。
166
+
167
+ 对方**没装 / 尚未挂载 / 没生效 / 版本低于 0.14.0** ⇒ 一律**不摘**:宁可名录里多一个条目,
168
+ 也绝不因为"探测不到对方"就少给用户一个模式。默认关,所以不主动打开就没有任何行为变化。
169
+
170
+ **生效时机**:
171
+
172
+ - **新宿主(dsh ≥ 0.1.7)是实时的**:开关走行 Config 的 volatile 通道,对方的能力则经
173
+ `ctx.inject(['ptcCordisPreset'])` 观察(**与插件行激活顺序无关**),两边任一变化都当场
174
+ reconcile——摘掉打日志 `preset 'cordis-gitbash' retired (dsh-ptc-cordis-preset covers Creation
175
+ mode on Git Bash)`,恢复打 `preset 'cordis-gitbash' registered declaratively`。已经挂载的会话
176
+ 钉在自己的组合快照上,不受影响;名录变化从新会话开始可见。
177
+ - **旧宿主(dsh ≤ 0.1.6)是启动时判定一次**:旧宿主没有可观察的注册表,能力探测是有界的
178
+ (默认 1s,读不到即视为"对方不覆盖"),所以打开开关后,上一轮物化出来的 `cordis-gitbash`
179
+ 目录会被清理;把开关关掉后,该变体要到**下一次启动**才重新物化。
180
+
181
+ **两侧设置卡上是同一份状态**:权威值只有本插件这一行 Config 一份;对方的设置卡通过
182
+ `ctx.configForms.get('gitbash-shell')` **绑定同一行**、写同一个字段(DSH 官方支持编辑另一个
183
+ 插件所拥有的命名空间),所以任一侧改动另一侧立即同步——不存在两份拷贝,也没有同步逻辑。
184
+ 旧宿主上 `configForms` 不存在、镜像卡片不出现,开关只在本插件自己的设置面(`gitbash-shell`
185
+ 命名空间)可改。
186
+
187
+ **依赖版本**:去重开关本体在**本插件 ≥ 0.25.0**;对方的协作能力在
188
+ **dsh-ptc-cordis-preset ≥ 0.14.0**。
189
+
147
190
  ## POSIX 路径方言(v0.7.0 引入,受 `posixPaths` 开关门控)
148
191
 
149
192
  Windows 上本插件把宿主 shell 换成 Git Bash 的同时,让**模型看到的路径**统一成 MSYS 盘根
package/README_EN.md CHANGED
@@ -69,6 +69,26 @@ the pwsh executor did.
69
69
 
70
70
  ## Config
71
71
 
72
+ The `gitbash-shell` row (its id has matched the settings namespace since v0.24.0; it was
73
+ `gitbash-presets` through v0.23.0) takes the materialized `presets` list and the cooperation
74
+ switch:
75
+
76
+ ```yaml
77
+ - id: gitbash-shell
78
+ config:
79
+ presets: [standard-gitbash, minimal-gitbash] # all four by default
80
+ suppressPeerCordis: false # dedupe against dsh-ptc-cordis-preset, off by default
81
+ ```
82
+
83
+ `suppressPeerCordis` (boolean, **off by default**) drops `创造模式 · Git Bash` (`cordis-gitbash`)
84
+ from the roster only while two facts hold **at the same time**: the switch is `true` **and**
85
+ dsh-ptc-cordis-preset reports that its `PTC 创造模式` is the Git Bash variant. Off by default means
86
+ the four-variant roster of 0.24.x is unchanged; see
87
+ [Cooperation with dsh-ptc-cordis-preset](#cooperation-with-dsh-ptc-cordis-preset) for the decision
88
+ rule, the timing, and how both sides share one state.
89
+
90
+ Executor config:
91
+
72
92
  ```yaml
73
93
  config:
74
94
  bashPath: "D:/Tools/Git/bin/bash.exe" # default C:/Program Files/Git/bin/bash.exe
@@ -83,6 +103,48 @@ the PTC preset is materialized as Git Bash automatically (tool-bash on,
83
103
  tool-pwsh off) — no extra mode, no manual edits. Without this plugin the PTC
84
104
  preset stays as its own plugin manages it.
85
105
 
106
+ ### Dedupe switch: `suppressPeerCordis` (off by default, v0.25.0)
107
+
108
+ Once the cooperation is active, `创造模式 · Git Bash` (this plugin's `cordis-gitbash`) and the
109
+ peer's Git Bash-materialized `PTC 创造模式` describe the same mode, and with both plugins installed
110
+ they are listed side by side by default. Turning on `suppressPeerCordis` in this plugin's row
111
+ Config is what retires this plugin's variant (request and tradeoffs:
112
+ [issue #7](https://github.com/KannaKuron/dsh-gitbash-shell/issues/7)).
113
+
114
+ **Two facts must BOTH hold — neither alone is enough:**
115
+
116
+ - the switch is `true`;
117
+ - and the peer reports `gitBashActive: true` through the `ptcCordisPreset` host capability (that
118
+ is, its `PTC 创造模式` really is the Git Bash variant).
119
+
120
+ A peer that is **absent / not mounted yet / not active / older than 0.14.0** ⇒ nothing is dropped:
121
+ we would rather show one extra roster entry than cost the user a mode because the peer could not be
122
+ seen. The switch is off by default, so nothing changes unless you ask for it.
123
+
124
+ **When it takes effect:**
125
+
126
+ - **New hosts (dsh ≥ 0.1.7) — live**: the switch rides the row Config's volatile channel and the
127
+ peer capability is watched through `ctx.inject(['ptcCordisPreset'])` (**independent of plugin row
128
+ activation order**); either change reconciles on the spot — retiring logs `preset 'cordis-gitbash'
129
+ retired (dsh-ptc-cordis-preset covers Creation mode on Git Bash)`, restoring logs `preset
130
+ 'cordis-gitbash' registered declaratively`. Sessions already mounted keep their own composition
131
+ snapshot and are never rewritten; the roster change shows up for new sessions.
132
+ - **Old hosts (dsh ≤ 0.1.6) — decided once at startup**: there is no registration registry to watch
133
+ and the capability probe is bounded (1s by default; "not seen" counts as "not covered"), so
134
+ turning the switch on cleans up the `cordis-gitbash` directory an earlier boot materialized,
135
+ while turning it back off re-materializes that variant on the **next startup** only.
136
+
137
+ **Both settings cards show one and the same state**: the single authoritative value lives in this
138
+ plugin's own row Config; the peer's card binds that same row through
139
+ `ctx.configForms.get('gitbash-shell')` and writes the same field (DSH officially supports editing a
140
+ namespace another plugin owns), so a change on either side shows up on the other immediately —
141
+ there is no second copy and no sync logic. On old hosts `configForms` does not exist, the mirrored
142
+ card never appears, and the switch is only editable on this plugin's own surface (the
143
+ `gitbash-shell` namespace).
144
+
145
+ **Versions**: the switch itself ships in **this plugin ≥ 0.25.0**; the peer's cooperation
146
+ capability ships in **dsh-ptc-cordis-preset ≥ 0.14.0**.
147
+
86
148
  ## POSIX path dialect (introduced in v0.7.0, gated by the `posixPaths` switch)
87
149
 
88
150
  While replacing the host shell with Git Bash on Windows, this plugin makes every path the
package/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-gitbash-shell",
3
- "version": "0.24.3",
3
+ "version": "0.25.0",
4
4
  "main": "./src/index.js",
5
5
  "description": "Windows 全模式 Git Bash:用 Git for Windows bash 替换 PowerShell 执行器,并物化 standard/minimal/code/cordis 的 Git Bash 变体 preset。双 era 适配 dsh <= 0.1.1(内置 id 'code')与 >= 0.1.2(改名 'ptc'),启动探测自动选择,preset id 永不变。联动:dsh-ptc-cordis-preset(两者同装时 PTC 创造模式自动物化为 Git Bash 版)+ dsh-better-sidebar(终端 UI 标签与模型 terminal_* 工具自动切到 Git Bash)。",
6
6
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gitbash-shell",
3
- "version": "0.24.3",
3
+ "version": "0.25.0",
4
4
  "description": "Windows 上让 agent 的每条 shell 命令改经 Git for Windows bash 执行;物化四个内置预设的 Git Bash 变体,统一 MSYS 盘根路径方言,侧栏终端接管可开关。· Run every agent shell command through Git for Windows bash on Windows; materialize Git Bash variants of the built-in presets, unify the MSYS drive-root path dialect, and adopt the sidebar terminal behind a switch.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -38,6 +38,7 @@
38
38
  "assets",
39
39
  "cordis.patch.yml",
40
40
  "dsh.plugin.json",
41
+ "CHANGELOG.md",
41
42
  "README.md",
42
43
  "README_EN.md",
43
44
  "LICENSE",
package/src/client.js CHANGED
@@ -46,6 +46,11 @@ window.__ModuleLoader__.load({
46
46
  var NS = "gitbashShell";
47
47
  /** The settings namespace the HOST half serves. */
48
48
  var SETTINGS_NAMESPACE = "gitbash-shell";
49
+ /** The PEER row this card mirrors: dsh-ptc-cordis-preset's own entry. Only
50
+ its existence is read here — the switch value itself lives on THIS
51
+ plugin's row (the single authoritative copy the peer card binds too) —
52
+ and the section is drawn only while that entry is actually served. */
53
+ var PEER_NS = "ptc-cordis";
49
54
 
50
55
  // ── dictionaries ────────────────────────────────────────────────────────
51
56
  // zh/en stay inline; the third languages live in LOCALES below, one entry
@@ -81,6 +86,9 @@ window.__ModuleLoader__.load({
81
86
  "bash.saved": "已保存",
82
87
  "adopt.label": "接管侧栏终端",
83
88
  "adopt.hint": "开启时把 dsh-better-sidebar 的终端 shell 写成 Git Bash(默认开启);关闭后恢复接管前的值,已手动改过的终端设置不会被碰。模型侧的 bash 工具不受此开关影响——那由插件本体提供。",
89
+ "sec.dedupe": "与 PTC 创造模式去重",
90
+ "dedupe.label": "「创造模式 · Git Bash」重复项",
91
+ "dedupe.hint": "dsh-ptc-cordis-preset 同装时,它的「PTC 创造模式」在联动下已是 Git Bash 版,与本插件的「创造模式 · Git Bash」指向同一件事。开启去重后本插件不再注册那一条(名录少一项);默认关闭,保持四个变体不变。此开关就是对方设置卡上的同一个开关——两侧共享同一份状态,任一侧改动另一侧立即同步。仅在已安装 dsh-ptc-cordis-preset 时显示。",
84
92
  };
85
93
 
86
94
  var en = {
@@ -111,6 +119,9 @@ window.__ModuleLoader__.load({
111
119
  "bash.saved": "Saved",
112
120
  "adopt.label": "Adopt sidebar terminal",
113
121
  "adopt.hint": "On (default) writes Git Bash into dsh-better-sidebar's terminal shell; turning it off restores the pre-adoption value and never touches a manually chosen one. The model-side bash tool is unaffected — the plugin itself provides that.",
122
+ "sec.dedupe": "Dedupe with PTC creation mode",
123
+ "dedupe.label": "\"Creation mode · Git Bash\" duplicate",
124
+ "dedupe.hint": "With dsh-ptc-cordis-preset installed alongside, its \"PTC creation mode\" is already the Git Bash variant under the link-up, so it and this plugin's \"creation mode · Git Bash\" point at the same thing. With dedupe on, this plugin stops registering that entry (one fewer in the roster); off by default, which keeps the four variants unchanged. This switch is the very same switch on the peer's settings card — both sides share one state, so a change on either side syncs to the other immediately. Shown only while dsh-ptc-cordis-preset is installed.",
114
125
  };
115
126
 
116
127
  /* Third-language dictionaries: one entry per language, each preceded
@@ -151,6 +162,9 @@ window.__ModuleLoader__.load({
151
162
  "bash.saved": "تم الحفظ",
152
163
  "adopt.label": "تبنّي طرفية الشريط الجانبي",
153
164
  "adopt.hint": "عند التفعيل (افتراضي) تُكتب Git Bash كـ shell لطرفية dsh-better-sidebar؛ وعند التعطيل تُستعاد القيمة السابقة ولا تُلمس القيمة المختارة يدويًا أبدًا. أداة bash الخاصة بالنموذج لا تتأثر — الإضافة نفسها توفرها.",
165
+ "sec.dedupe": "إزالة التكرار مع وضع PTC الإبداعي",
166
+ "dedupe.label": "عنصر «وضع الإبداع · Git Bash» المكرر",
167
+ "dedupe.hint": "عند تثبيت dsh-ptc-cordis-preset معًا، يكون «وضع PTC الإبداعي» لديه بالفعل نسخة Git Bash في إطار الربط، فيشير هو و«وضع الإبداع · Git Bash» في هذه الإضافة إلى الشيء نفسه. عند تفعيل إزالة التكرار تتوقف هذه الإضافة عن تسجيل ذلك العنصر (عنصر أقل في القائمة)؛ والمعطَّل افتراضيًا يُبقي المتغيّرات الأربعة كما هي. هذا المفتاح هو نفسه المفتاح الموجود على بطاقة إعدادات الطرف الآخر — الجانبان يتشاركان الحالة نفسها، وأي تغيير في أحد الجانبين يُزامَن فورًا مع الآخر. يظهر فقط عندما يكون dsh-ptc-cordis-preset مثبَّتًا.",
154
168
  },
155
169
  /* locale: de */
156
170
  "de": {
@@ -181,6 +195,9 @@ window.__ModuleLoader__.load({
181
195
  "bash.saved": "Gespeichert",
182
196
  "adopt.label": "Sidebar-Terminal übernehmen",
183
197
  "adopt.hint": "Ein (Standard) schreibt Git Bash als Shell des dsh-better-sidebar-Terminals; Aus stellt den vorherigen Wert wieder her und fasst nie eine manuell gewählte Einstellung an. Das bash-Werkzeug des Modells bleibt unberührt — das liefert das Plugin selbst.",
198
+ "sec.dedupe": "Deduplizierung mit dem PTC-Kreativmodus",
199
+ "dedupe.label": "Doppelter Eintrag „Kreativmodus · Git Bash“",
200
+ "dedupe.hint": "Ist dsh-ptc-cordis-preset mitinstalliert, ist dessen „PTC-Kreativmodus“ durch die Verknüpfung bereits die Git-Bash-Fassung und zeigt damit auf dasselbe wie der „Kreativmodus · Git Bash“ dieses Plugins. Mit aktiver Deduplizierung registriert dieses Plugin den eigenen Eintrag nicht mehr (ein Eintrag weniger im Verzeichnis); standardmäßig aus, die vier Varianten bleiben unverändert. Dieser Schalter ist derselbe Schalter auf der Einstellungskarte der Gegenseite — beide Seiten teilen einen Zustand, eine Änderung auf einer Seite erreicht die andere sofort. Nur sichtbar, solange dsh-ptc-cordis-preset installiert ist.",
184
201
  },
185
202
  /* locale: fr */
186
203
  "fr": {
@@ -211,6 +228,9 @@ window.__ModuleLoader__.load({
211
228
  "bash.saved": "Enregistré",
212
229
  "adopt.label": "Adopter le terminal latéral",
213
230
  "adopt.hint": "Activé (par défaut) : écrit Git Bash comme shell du terminal dsh-better-sidebar ; désactivé : restaure la valeur davant et ne touche jamais un choix manuel. Loutil bash du modèle nest pas concerné — le plugin le fournit lui-même.",
231
+ "sec.dedupe": "Dédoublonnage avec le mode création PTC",
232
+ "dedupe.label": "Entrée en double « mode création · Git Bash »",
233
+ "dedupe.hint": "Lorsque dsh-ptc-cordis-preset est installé en même temps, son « mode création PTC » est déjà la version Git Bash grâce à l'appairage : lui et le « mode création · Git Bash » de ce plugin désignent la même chose. Une fois le dédoublonnage activé, ce plugin n'enregistre plus sa propre entrée (une entrée de moins dans le catalogue) ; désactivé par défaut, ce qui laisse les quatre variantes intactes. Cet interrupteur est exactement le même que sur la carte de réglages d'en face — les deux côtés partagent un seul état, toute modification d'un côté est synchronisée immédiatement de l'autre. Affiché uniquement lorsque dsh-ptc-cordis-preset est installé.",
214
234
  },
215
235
  /* locale: hi */
216
236
  "hi": {
@@ -241,6 +261,9 @@ window.__ModuleLoader__.load({
241
261
  "bash.saved": "सहेजा गया",
242
262
  "adopt.label": "साइडबार टर्मिनल अपनाएँ",
243
263
  "adopt.hint": "चालू (डिफ़ॉल्ट) होने पर dsh-better-sidebar के टर्मिनल में Git Bash लिखा जाता है; बंद करने पर पहले वाली मान बहाल होती है और मैन्युअल चुनी गई सेटिंग कभी नहीं छुई जाती। मॉडल का bash टूल अप्रभावित रहता है — वह प्लगइन स्वयं देता है।",
264
+ "sec.dedupe": "PTC क्रिएशन मोड के साथ डुप्लीकेट हटाना",
265
+ "dedupe.label": "«क्रिएशन मोड · Git Bash» की डुप्लीकेट प्रविष्टि",
266
+ "dedupe.hint": "जब dsh-ptc-cordis-preset साथ में इंस्टॉल होता है, तो लिंक-अप के कारण उसका «PTC क्रिएशन मोड» पहले से Git Bash रूप है, और वह इस प्लगइन के «क्रिएशन मोड · Git Bash» के साथ एक ही चीज़ दर्शाता है। डुप्लीकेट हटाना चालू करने पर यह प्लगइन अपनी वह प्रविष्टि पंजीकृत नहीं करता (सूची में एक कम); डिफ़ॉल्ट रूप से बंद, जिससे चारों वेरिएंट अपरिवर्तित रहते हैं। यह स्विच सामने वाले की सेटिंग कार्ड पर मौजूद ठीक वही स्विच है — दोनों ओर एक ही स्थिति साझा होती है, किसी एक ओर बदलाव तुरंत दूसरी ओर सिंक होता है। यह केवल तभी दिखता है जब dsh-ptc-cordis-preset इंस्टॉल हो।",
244
267
  },
245
268
  /* locale: id */
246
269
  "id": {
@@ -271,6 +294,9 @@ window.__ModuleLoader__.load({
271
294
  "bash.saved": "Tersimpan",
272
295
  "adopt.label": "Adopsi terminal sidebar",
273
296
  "adopt.hint": "Nyala (bawaan) menulis Git Bash sebagai shell terminal dsh-better-sidebar; dimatikan memulihkan nilai sebelumnya dan tidak pernah menyentuh pilihan manual. Alat bash sisi model tak terpengaruh — plugin sendiri yang menyediakannya.",
297
+ "sec.dedupe": "Deduplikasi dengan mode kreatif PTC",
298
+ "dedupe.label": "Entri duplikat «mode kreatif · Git Bash»",
299
+ "dedupe.hint": "Saat dsh-ptc-cordis-preset terpasang bersama, «mode kreatif PTC» miliknya sudah menjadi versi Git Bash berkat keterkaitan, sehingga ia dan «mode kreatif · Git Bash» plugin ini menunjuk hal yang sama. Dengan deduplikasi aktif, plugin ini berhenti mendaftarkan entrinya sendiri (berkurang satu di daftar); nonaktif secara bawaan, sehingga keempat varian tetap utuh. Sakelar ini adalah sakelar yang sama di kartu setelan pihak lain — kedua sisi berbagi satu status, perubahan di salah satu sisi langsung tersinkron ke sisi lain. Hanya tampil saat dsh-ptc-cordis-preset terpasang.",
274
300
  },
275
301
  /* locale: it */
276
302
  "it": {
@@ -301,6 +327,9 @@ window.__ModuleLoader__.load({
301
327
  "bash.saved": "Salvato",
302
328
  "adopt.label": "Adotta il terminale laterale",
303
329
  "adopt.hint": "Attivo (predefinito) imposta Git Bash come shell del terminale di dsh-better-sidebar; disattivo ripristina il valore precedente e non tocca mai una scelta manuale. Lo strumento bash del modello non è interessato — lo fornisce il plugin stesso.",
330
+ "sec.dedupe": "Deduplicazione con la modalità creazione PTC",
331
+ "dedupe.label": "Voce duplicata «modalità creazione · Git Bash»",
332
+ "dedupe.hint": "Quando dsh-ptc-cordis-preset è installato insieme, la sua «modalità creazione PTC» è già la versione Git Bash grazie al collegamento: essa e la «modalità creazione · Git Bash» di questo plugin indicano la stessa cosa. Attivando la deduplicazione questo plugin non registra più la propria voce (una in meno nell'elenco); disattivata per impostazione predefinita, lascia intatte le quattro varianti. Questo interruttore è lo stesso presente sulla scheda impostazioni dell'altra parte — entrambe le parti condividono un unico stato, una modifica su un lato si sincronizza subito sull'altro. Visibile solo quando dsh-ptc-cordis-preset è installato.",
304
333
  },
305
334
  /* locale: ja */
306
335
  "ja": {
@@ -331,6 +360,9 @@ window.__ModuleLoader__.load({
331
360
  "bash.saved": "保存済み",
332
361
  "adopt.label": "サイドバーターミナルを引き継ぐ",
333
362
  "adopt.hint": "オン(既定)では dsh-better-sidebar のターミナルシェルに Git Bash を書き込みます。オフにすると以前の値へ戻し、手動で選択した設定には決して触れません。モデル側の bash ツールには影響しません——それはプラグイン本体が提供します。",
363
+ "sec.dedupe": "PTC 創造モードとの重複排除",
364
+ "dedupe.label": "「創造モード · Git Bash」の重複項目",
365
+ "dedupe.hint": "dsh-ptc-cordis-preset を併用している場合、連携により相手の「PTC 創造モード」はすでに Git Bash 版であり、本プラグインの「創造モード · Git Bash」と同じものを指します。重複排除を有効にすると本プラグインは自前の項目を登録しなくなります(名簿が 1 件減ります)。既定は無効で、4 つのバリアントは変わりません。このスイッチは相手の設定カードにあるものと同一で、両側が同じ状態を共有し、どちらかで変更すればもう一方へ即座に同期されます。dsh-ptc-cordis-preset がインストールされているときだけ表示されます。",
334
366
  },
335
367
  /* locale: ko */
336
368
  "ko": {
@@ -361,6 +393,9 @@ window.__ModuleLoader__.load({
361
393
  "bash.saved": "저장됨",
362
394
  "adopt.label": "사이드바 터미널 인수",
363
395
  "adopt.hint": "켜짐(기본)이면 dsh-better-sidebar 터미널 셸에 Git Bash를 기록하고, 끄면 이전 값을 복원하며 수동으로 고른 설정은 절대 건드리지 않습니다. 모델 측 bash 도구에는 영향이 없습니다 — 플러그인이 직접 제공합니다.",
396
+ "sec.dedupe": "PTC 창조 모드와 중복 제거",
397
+ "dedupe.label": "«창조 모드 · Git Bash» 중복 항목",
398
+ "dedupe.hint": "dsh-ptc-cordis-preset을 함께 설치하면 연동으로 인해 상대의 «PTC 창조 모드»가 이미 Git Bash 버전이므로, 그것과 이 플러그인의 «창조 모드 · Git Bash»는 같은 것을 가리킵니다. 중복 제거를 켜면 이 플러그인은 자기 항목을 더 이상 등록하지 않습니다(명부에서 하나 줄어듦). 기본값은 꺼짐이며 네 가지 변형은 그대로 유지됩니다. 이 스위치는 상대 설정 카드에 있는 바로 그 스위치입니다 — 양쪽이 같은 상태를 공유하므로 어느 쪽에서 바꾸든 다른 쪽에 즉시 동기화됩니다. dsh-ptc-cordis-preset이 설치되어 있을 때만 표시됩니다.",
364
399
  },
365
400
  /* locale: nl */
366
401
  "nl": {
@@ -391,6 +426,9 @@ window.__ModuleLoader__.load({
391
426
  "bash.saved": "Opgeslagen",
392
427
  "adopt.label": "Zijbalkterminal overnemen",
393
428
  "adopt.hint": "Aan (standaard) schrijft Git Bash als shell van de dsh-better-sidebar-terminal; uit herstelt de vorige waarde en raakt nooit een handmatige keuze aan. De bash-tool van het model blijft buiten beschouwing — die levert de plugin zelf.",
429
+ "sec.dedupe": "Deduplicatie met de PTC-creatiemodus",
430
+ "dedupe.label": "Dubbele vermelding ‘creatiemodus · Git Bash’",
431
+ "dedupe.hint": "Als dsh-ptc-cordis-preset meegaat, is zijn ‘PTC-creatiemodus’ door de koppeling al de Git Bash-variant, dus die en de ‘creatiemodus · Git Bash’ van deze plugin wijzen op hetzelfde. Met deduplicatie aan registreert deze plugin die eigen vermelding niet meer (één minder in de lijst); standaard uit, waardoor de vier varianten ongewijzigd blijven. Deze schakelaar is dezelfde als op de instellingenkaart van de andere kant — beide kanten delen één status, een wijziging aan één kant synct direct naar de andere. Alleen zichtbaar zolang dsh-ptc-cordis-preset is geïnstalleerd.",
394
432
  },
395
433
  /* locale: pl */
396
434
  "pl": {
@@ -421,6 +459,9 @@ window.__ModuleLoader__.load({
421
459
  "bash.saved": "Zapisano",
422
460
  "adopt.label": "Przejmij terminal boczny",
423
461
  "adopt.hint": "Włączony (domyślnie) zapisuje Git Bash jako shell terminala dsh-better-sidebar; wyłączony przywraca poprzednią wartość i nigdy nie narusza ręcznie wybranego ustawienia. Narzędzie bash po stronie modelu jest nietknięte — zapewnia je sama wtyczka.",
462
+ "sec.dedupe": "Deduplikacja z trybem tworzenia PTC",
463
+ "dedupe.label": "Zduplikowany wpis „tryb tworzenia · Git Bash”",
464
+ "dedupe.hint": "Gdy dsh-ptc-cordis-preset jest zainstalowany razem, jego „tryb tworzenia PTC” jest już dzięki powiązaniu wersją Git Bash, więc on i „tryb tworzenia · Git Bash” tej wtyczki oznaczają to samo. Po włączeniu deduplikacji ta wtyczka nie rejestruje już własnego wpisu (o jeden mniej w wykazie); domyślnie wyłączona, dzięki czemu cztery warianty pozostają bez zmian. Ten przełącznik to ten sam przełącznik na karcie ustawień drugiej strony — obie strony dzielą jeden stan, zmiana po jednej stronie natychmiast synchronizuje się z drugą. Widoczny tylko, gdy dsh-ptc-cordis-preset jest zainstalowany.",
424
465
  },
425
466
  /* locale: pt */
426
467
  "pt": {
@@ -451,6 +492,9 @@ window.__ModuleLoader__.load({
451
492
  "bash.saved": "Salvo",
452
493
  "adopt.label": "Adotar o terminal lateral",
453
494
  "adopt.hint": "Ligado (padrão) grava o Git Bash como shell do terminal do dsh-better-sidebar; desligado restaura o valor anterior e nunca altera uma escolha manual. A ferramenta bash do modelo não é afetada — o próprio plug-in a fornece.",
495
+ "sec.dedupe": "Desduplicação com o modo de criação PTC",
496
+ "dedupe.label": "Entrada duplicada «modo de criação · Git Bash»",
497
+ "dedupe.hint": "Quando o dsh-ptc-cordis-preset está instalado em conjunto, o «modo de criação PTC» dele já é a versão Git Bash graças à integração, então ele e o «modo de criação · Git Bash» deste plugin apontam para a mesma coisa. Com a desduplicação ligada, este plugin deixa de registar a sua própria entrada (uma a menos na lista); desligada por padrão, mantendo as quatro variantes inalteradas. Este interruptor é o mesmo do cartão de definições do outro lado — os dois lados partilham um único estado, e uma alteração de um lado sincroniza imediatamente com o outro. Só aparece quando o dsh-ptc-cordis-preset está instalado.",
454
498
  },
455
499
  /* locale: ru */
456
500
  "ru": {
@@ -481,6 +525,9 @@ window.__ModuleLoader__.load({
481
525
  "bash.saved": "Сохранено",
482
526
  "adopt.label": "Перехватывать терминал боковой панели",
483
527
  "adopt.hint": "Включено (по умолчанию): Git Bash записывается как shell терминала dsh-better-sidebar; выключено — восстанавливается прежнее значение, вручную выбранные настройки не трогаются. Инструмент bash у модели не затронут — его предоставляет сам плагин.",
528
+ "sec.dedupe": "Удаление дубликата с творческим режимом PTC",
529
+ "dedupe.label": "Дублирующая запись «творческий режим · Git Bash»",
530
+ "dedupe.hint": "Если dsh-ptc-cordis-preset установлен вместе, его «творческий режим PTC» благодаря связке уже является версией Git Bash, поэтому он и «творческий режим · Git Bash» этого плагина указывают на одно и то же. При включённом удалении дубликатов плагин больше не регистрирует свою запись (в списке на одну меньше); по умолчанию выключено, четыре варианта остаются без изменений. Этот переключатель — тот же самый на карточке настроек у второй стороны: обе стороны делят одно состояние, изменение с любой стороны сразу синхронизируется с другой. Показывается только когда установлен dsh-ptc-cordis-preset.",
484
531
  },
485
532
  /* locale: sv */
486
533
  "sv": {
@@ -511,6 +558,9 @@ window.__ModuleLoader__.load({
511
558
  "bash.saved": "Sparat",
512
559
  "adopt.label": "Överta sidolistterminal",
513
560
  "adopt.hint": "På (standard) skriver Git Bash som terminal-shell i dsh-better-sidebar; av återställer det tidigare värdet och rör aldrig ett manuellt val. Modellens bash-verktyg påverkas inte — det tillhandahålls av pluginet självt.",
561
+ "sec.dedupe": "Deduplicering med PTC-skaparläget",
562
+ "dedupe.label": "Dubblerad post ”skaparläge · Git Bash”",
563
+ "dedupe.hint": "När dsh-ptc-cordis-preset är installerat samtidigt är dess ”PTC-skaparläge” redan Git Bash-versionen tack vare kopplingen, så det och det här pluginets ”skaparläge · Git Bash” pekar på samma sak. Med deduplicering på registrerar pluginet inte längre sin egen post (en färre i listan); av som standard, vilket lämnar de fyra varianterna oförändrade. Den här växeln är samma växel som på motpartens inställningskort — båda sidor delar ett tillstånd, en ändring på ena sidan synkas direkt till den andra. Visas bara när dsh-ptc-cordis-preset är installerat.",
514
564
  },
515
565
  /* locale: th */
516
566
  "th": {
@@ -541,6 +591,9 @@ window.__ModuleLoader__.load({
541
591
  "bash.saved": "บันทึกแล้ว",
542
592
  "adopt.label": "รับช่วงเทอร์มินัลแถบข้าง",
543
593
  "adopt.hint": "เปิด (ค่าเริ่มต้น) จะเขียน Git Bash เป็น shell ของเทอร์มินัล dsh-better-sidebar; ปิดแล้วคืนค่าเดิมและไม่แตะการตั้งค่าที่เลือกเอง เครื่องมือ bash ของโมเดลไม่กระทบ — ปลั๊กอินจัดหาเอง",
594
+ "sec.dedupe": "ตัดรายการซ้ำกับโหมดสร้างสรรค์ PTC",
595
+ "dedupe.label": "รายการซ้ำ «โหมดสร้างสรรค์ · Git Bash»",
596
+ "dedupe.hint": "เมื่อติดตั้ง dsh-ptc-cordis-preset ควบคู่กัน «โหมดสร้างสรรค์ PTC» ของมันเป็นเวอร์ชัน Git Bash อยู่แล้วจากการเชื่อมโยง จึงชี้ไปที่สิ่งเดียวกันกับ «โหมดสร้างสรรค์ · Git Bash» ของปลั๊กอินนี้ เมื่อเปิดการตัดรายการซ้ำ ปลั๊กอินนี้จะไม่ลงทะเบียนรายการของตัวเองอีก (รายการในสารบบลดลงหนึ่งรายการ); ปิดไว้เป็นค่าเริ่มต้น จึงคงสี่รูปแบบไว้เหมือนเดิม สวิตช์นี้คือสวิตช์เดียวกันกับบนการ์ดตั้งค่าของอีกฝ่าย — ทั้งสองฝั่งใช้สถานะเดียวกัน แก้ที่ฝั่งใดอีกฝั่งจะซิงก์ทันที แสดงเฉพาะเมื่อติดตั้ง dsh-ptc-cordis-preset แล้วเท่านั้น",
544
597
  },
545
598
  /* locale: tr */
546
599
  "tr": {
@@ -571,6 +624,9 @@ window.__ModuleLoader__.load({
571
624
  "bash.saved": "Kaydedildi",
572
625
  "adopt.label": "Kenar çubuğu terminalini devral",
573
626
  "adopt.hint": "Açık (varsayılan) Git Bashi dsh-better-sidebar terminalinin shelli olarak yazar; kapalı önceki değeri geri getirir ve elle seçilmiş bir ayara asla dokunmaz. Model tarafındaki bash aracı etkilenmez — onu eklentinin kendisi sağlar.",
627
+ "sec.dedupe": "PTC yaratma moduyla yinelenen kaydı kaldırma",
628
+ "dedupe.label": "«Yaratma modu · Git Bash» yinelenen kaydı",
629
+ "dedupe.hint": "dsh-ptc-cordis-preset birlikte kuruluysa, bağlantı sayesinde onun «PTC yaratma modu» zaten Git Bash sürümüdür; dolayısıyla o ve bu eklentinin «Yaratma modu · Git Bash» kaydı aynı şeyi gösterir. Yinelenen kaydı kaldırma açıkken bu eklenti kendi kaydını artık kaydetmez (listede bir eksik); varsayılan olarak kapalıdır ve dört varyant değişmeden kalır. Bu anahtar, karşı tarafın ayar kartındaki anahtarın ta kendisidir — iki taraf aynı durumu paylaşır, bir taraftaki değişiklik anında diğerine eşitlenir. Yalnızca dsh-ptc-cordis-preset kurulu olduğunda görünür.",
574
630
  },
575
631
  /* locale: vi */
576
632
  "vi": {
@@ -601,6 +657,9 @@ window.__ModuleLoader__.load({
601
657
  "bash.saved": "Đã lưu",
602
658
  "adopt.label": "Tiếp nhận terminal thanh bên",
603
659
  "adopt.hint": "Bật (mặc định) ghi Git Bash làm shell terminal của dsh-better-sidebar; tắt khôi phục giá trị trước đó và không bao giờ đụng tới lựa chọn thủ công. Công cụ bash phía mô hình không bị ảnh hưởng — chính plugin cung cấp nó.",
660
+ "sec.dedupe": "Loại bỏ trùng lặp với chế độ sáng tạo PTC",
661
+ "dedupe.label": "Mục trùng lặp «chế độ sáng tạo · Git Bash»",
662
+ "dedupe.hint": "Khi cài chung dsh-ptc-cordis-preset, nhờ liên kết mà «chế độ sáng tạo PTC» của nó đã là bản Git Bash, nên nó và «chế độ sáng tạo · Git Bash» của plugin này cùng chỉ một thứ. Khi bật loại bỏ trùng lặp, plugin này không đăng ký mục của riêng nó nữa (danh mục bớt một mục); mặc định tắt, giữ nguyên bốn biến thể. Công tắc này chính là công tắc trên thẻ cài đặt của bên kia — hai bên dùng chung một trạng thái, thay đổi ở bên nào cũng đồng bộ ngay sang bên kia. Chỉ hiện khi đã cài dsh-ptc-cordis-preset.",
604
663
  },
605
664
  /* locale: zh-hk */
606
665
  "zh-hk": {
@@ -631,6 +690,9 @@ window.__ModuleLoader__.load({
631
690
  "bash.saved": "已儲存",
632
691
  "adopt.label": "接管側欄終端",
633
692
  "adopt.hint": "開啟(預設)會把 dsh-better-sidebar 的終端 shell 寫成 Git Bash;關閉後還原接管前的值,手動改過的設定永不被碰。模型側的 bash 工具不受影響——由插件本身提供。",
693
+ "sec.dedupe": "與 PTC 創造模式去重",
694
+ "dedupe.label": "「創造模式 · Git Bash」重複項",
695
+ "dedupe.hint": "裝埋 dsh-ptc-cordis-preset 嗰陣,佢嘅「PTC 創造模式」喺聯動下已經係 Git Bash 版,同本插件嘅「創造模式 · Git Bash」指向同一件事。開咗去重之後本插件唔再註冊嗰一條(名錄少一項);預設關閉,保持四個變體不變。呢個開關就係對方設定卡上面同一個開關——兩邊共享同一份狀態,任一邊改動另一邊即刻同步。只喺已安裝 dsh-ptc-cordis-preset 時顯示。",
634
696
  },
635
697
  /* locale: zh-mo */
636
698
  "zh-mo": {
@@ -661,6 +723,9 @@ window.__ModuleLoader__.load({
661
723
  "bash.saved": "已儲存",
662
724
  "adopt.label": "接管側欄終端",
663
725
  "adopt.hint": "開啟(預設)會把 dsh-better-sidebar 的終端 shell 寫成 Git Bash;關閉後還原接管前的值,手動改過的設定永不被碰。模型側的 bash 工具不受影響——由插件本身提供。",
726
+ "sec.dedupe": "與 PTC 創造模式去重",
727
+ "dedupe.label": "「創造模式 · Git Bash」重複項",
728
+ "dedupe.hint": "裝埋 dsh-ptc-cordis-preset 嗰陣,佢嘅「PTC 創造模式」喺聯動下已經係 Git Bash 版,同本插件嘅「創造模式 · Git Bash」指向同一件事。開咗去重之後本插件唔再註冊嗰一條(名錄少一項);預設關閉,保持四個變體不變。呢個開關就係對方設定卡上面同一個開關——兩邊共享同一份狀態,任一邊改動另一邊即刻同步。只喺已安裝 dsh-ptc-cordis-preset 時顯示。",
664
729
  },
665
730
  /* locale: zh-tw */
666
731
  "zh-tw": {
@@ -691,6 +756,9 @@ window.__ModuleLoader__.load({
691
756
  "bash.saved": "已儲存",
692
757
  "adopt.label": "接管側欄終端機",
693
758
  "adopt.hint": "開啟(預設)會把 dsh-better-sidebar 的終端機 shell 寫成 Git Bash;關閉後還原接管前的值,手動改過的設定永不被碰。模型側的 bash 工具不受影響——由插件本身提供。",
759
+ "sec.dedupe": "與 PTC 創造模式去重",
760
+ "dedupe.label": "「創造模式 · Git Bash」重複項目",
761
+ "dedupe.hint": "同時安裝 dsh-ptc-cordis-preset 時,它的「PTC 創造模式」在聯動下已是 Git Bash 版,與本插件的「創造模式 · Git Bash」指向同一件事。開啟去重後本插件不再註冊那一條(清單少一項);預設關閉,保持四個變體不變。這個開關就是對方設定卡上的同一個開關——兩側共享同一份狀態,任一側改動另一側立即同步。僅在已安裝 dsh-ptc-cordis-preset 時顯示。",
694
762
  },
695
763
  };
696
764
 
@@ -887,6 +955,31 @@ window.__ModuleLoader__.load({
887
955
  var bumpTick = tickState[1];
888
956
  void tick;
889
957
 
958
+ /* The dedupe row mirrors the PEER's row: it is drawn only where
959
+ dsh-ptc-cordis-preset is installed and its entry has reached the
960
+ configForms mirror (dsh >= 0.1.7). Absent on old hosts (no
961
+ configForms), while the peer is not installed, or before its entry
962
+ appears; every step is defensive, and the form's own subscribe
963
+ bumps the tick so a late-arriving peer row still shows up. */
964
+ var peerState = useState(null);
965
+ var peer = peerState[0];
966
+ var setPeer = peerState[1];
967
+
968
+ useEffect(function () {
969
+ var forms;
970
+ try {
971
+ forms = props.ctx === undefined || props.ctx === null ? undefined : props.ctx.get("configForms");
972
+ } catch (error_) { forms = undefined; }
973
+ if (forms === undefined || forms === null || typeof forms.get !== "function") return undefined;
974
+ var form;
975
+ try { form = forms.get(PEER_NS); } catch (error_) { return undefined; }
976
+ if (form === undefined || form === null || typeof form.getSnapshot !== "function") return undefined;
977
+ setPeer(form);
978
+ if (typeof form.subscribe !== "function") return undefined;
979
+ var unsubscribe = form.subscribe(function () { bumpTick(function (n) { return n + 1; }); });
980
+ return typeof unsubscribe === "function" ? unsubscribe : undefined;
981
+ }, []);
982
+
890
983
  var bashState = useState("");
891
984
  var bashDraft = bashState[0];
892
985
  var setBashDraft = bashState[1];
@@ -935,6 +1028,7 @@ window.__ModuleLoader__.load({
935
1028
  var splits = snap.value.globSplit !== false;
936
1029
  var codes = snap.value.codePaths !== false;
937
1030
  var eolOn = snap.value.gitAutocrlf !== false;
1031
+ var dedupe = snap.value.suppressPeerCordis === true;
938
1032
 
939
1033
  var dialectSection = E("div", { className: "gb-section" },
940
1034
  E("div", { className: "gb-sectionTitle" }, t("sec.dialect")),
@@ -1019,9 +1113,34 @@ window.__ModuleLoader__.load({
1019
1113
  ),
1020
1114
  );
1021
1115
 
1116
+ /* Peer-gated section: rendered only while dsh-ptc-cordis-preset serves
1117
+ its own row. The value stays on THIS row — the peer card binds the
1118
+ same field through configForms — so the buttons write through
1119
+ writeField exactly like every other row on this card. */
1120
+ var peerSnap = { status: "unavailable" };
1121
+ try {
1122
+ if (peer && typeof peer.getSnapshot === "function") peerSnap = peer.getSnapshot();
1123
+ } catch (error_) { /* keep unavailable */ }
1124
+
1125
+ var dedupeSection = peerSnap.status === "ready" ? E("div", { className: "gb-section" },
1126
+ E("div", { className: "gb-sectionTitle" }, t("sec.dedupe")),
1127
+ E("div", { className: "gb-stack" },
1128
+ E("div", { className: "gb-row" },
1129
+ E("span", { className: "gb-rowLabel" }, t("dedupe.label") + ":"),
1130
+ E("span", { className: "gb-rowValue" }, dedupe ? t("state.on") : t("state.off")),
1131
+ ),
1132
+ E("div", { className: "gb-seg" },
1133
+ E("button", { type: "button", className: "gb-segBtn" + (dedupe ? " gb-segActive" : ""), onClick: function () { if (!dedupe) writeField("suppressPeerCordis", true); } }, t("switch.on")),
1134
+ E("button", { type: "button", className: "gb-segBtn" + (!dedupe ? " gb-segActive" : ""), onClick: function () { if (dedupe) writeField("suppressPeerCordis", false); } }, t("switch.off")),
1135
+ ),
1136
+ E("p", { className: "gb-hint" }, t("dedupe.hint")),
1137
+ ),
1138
+ ) : null;
1139
+
1022
1140
  var bodyContent = E("div", { className: "gb-body" },
1023
1141
  dialectSection,
1024
1142
  terminalSection,
1143
+ dedupeSection,
1025
1144
  error ? E("p", { className: "gb-error" }, error) : null,
1026
1145
  );
1027
1146
 
@@ -1132,9 +1251,10 @@ window.__ModuleLoader__.load({
1132
1251
  }
1133
1252
  var injected = function () {
1134
1253
  // The inject factory's returned members become the component's
1135
- // props: the bound settings scope rides here as a PLAIN member
1136
- // (top-level options fields do NOT reach the component).
1137
- return { scope: scope };
1254
+ // props: the bound settings scope AND the ctx (used to reach
1255
+ // configForms for the peer-gated dedupe row) ride here as PLAIN
1256
+ // members (top-level options fields do NOT reach the component).
1257
+ return { scope: scope, ctx: ctx };
1138
1258
  };
1139
1259
  // Legacy seat (dsh <= 0.1.6-alpha.1): Settings → Plugins card.
1140
1260
  slots.inject("settings.plugin.item", function () {