dsh-gitbash-shell 0.24.1 → 0.24.2

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/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-gitbash-shell",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
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.1",
3
+ "version": "0.24.2",
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": {
package/src/index.js CHANGED
@@ -1649,8 +1649,14 @@ let reconcileSidebar = () => {}
1649
1649
  * value is still ours, so a user's manual choice is never clobbered. The
1650
1650
  * polling keeps the original ready-wait behavior: at boot the settings
1651
1651
  * service may not be provided yet when this row's apply runs. Never throws.
1652
+ *
1653
+ * `readAdopt` is apply()'s era-aware gate getter (`() => liveSettings.
1654
+ * adoptSidebar()`), passed in because this module-level helper cannot see
1655
+ * that scope-local reader itself (v0.24.2 regression fix — referencing
1656
+ * `liveSettings` here threw `ReferenceError: liveSettings is not defined`
1657
+ * from `run()` and aborted the whole plugin mount).
1652
1658
  */
1653
- function adoptSidebarShell(ctx, bashPath) {
1659
+ function adoptSidebarShell(ctx, bashPath, readAdopt) {
1654
1660
  let adopted = false
1655
1661
  let previous = ''
1656
1662
  let tried = 0
@@ -1706,7 +1712,7 @@ function adoptSidebarShell(ctx, bashPath) {
1706
1712
 
1707
1713
  const run = () => {
1708
1714
  tried += 1
1709
- const ok = reconcileSidebar(liveSettings.adoptSidebar())
1715
+ const ok = reconcileSidebar(readAdopt())
1710
1716
  if (ok) {
1711
1717
  // The namespace scope may register after the settings service; hook
1712
1718
  // the live watch once it exists (idempotent via the effect disposer).
@@ -2250,7 +2256,7 @@ export async function apply(ctx, config = {}) {
2250
2256
  // open; adopt it through that seam (see adoptSidebarShell for rationale).
2251
2257
  // Disable with `betterSidebarShell: false` in the plugin row config.
2252
2258
  if (config.betterSidebarShell !== false && process.platform === 'win32') {
2253
- adoptSidebarShell(ctx, gitBashCapability.bashPath)
2259
+ adoptSidebarShell(ctx, gitBashCapability.bashPath, () => liveSettings.adoptSidebar())
2254
2260
  }
2255
2261
 
2256
2262
  // ── era split: declarative registration on dsh >= 0.1.7 ──────────────────