| 1 | # Windows shell startup / Windows Shell 启动 |
| 2 | |
| 3 | Windows auto selection uses PowerShell 7 or Windows PowerShell and never falls |
| 4 | back to Bash, even if an old Bash path remains configured. Restricted Windows |
| 5 | shell execution rejects POSIX interpreters before process preparation. Explicit |
| 6 | Bash selection remains available in full-access mode. |
| 7 | The tool description uses the selected interpreter's syntax and remains stable |
| 8 | within a configured session. |
| 9 | |
| 10 | Windows 自动选择只使用 PowerShell 7 或 Windows PowerShell,不再回退到 Bash, |
| 11 | 即使配置中留有旧 Bash 路径。受限沙箱会在准备进程前拒绝 POSIX 解释器;完整权限模式 |
| 12 | 仍可显式选择 Bash。工具描述使用实际解释器的语法,在同一配置的会话内保持稳定。 |
| 13 | |
| 14 | Host discovery is not sandbox qualification. Before model shell execution |
| 15 | (foreground, background or persistent) and user shell execution, a harmless |
| 16 | shell-and-child probe runs with the command's sandbox policy, workspace, |
| 17 | environment and private temporary directory. Failures retain bounded original |
| 18 | output and report that the requested command was not run. Repeated failures are |
| 19 | cached for 30 seconds, keyed by launch argv (including sandbox policy), cwd and |
| 20 | environment. Persistent PTY startup also preserves diagnostics and does not |
| 21 | silently retry a started-but-unready shell through the one-shot runner. |
| 22 | |
| 23 | 宿主环境发现可执行文件不代表沙箱内可用。模型的普通、后台、持久 Shell 入口,以及 |
| 24 | 用户直接执行入口,会先用实际策略、工作目录、环境和私有临时目录检查 Shell 与子进程。 |
| 25 | 失败时保留有界的原始输出,并明确业务命令未执行。失败缓存持续 30 秒,按启动参数 |
| 26 | (包含沙箱策略)、工作目录和环境隔离。持久 PTY 启动失败也保留诊断,不再静默退回 |
| 27 | 一次性执行重复启动已经失败的解释器。 |
| 28 | |
| 29 | ## Qualification boundary / 验证边界 |
| 30 | |
| 31 | These changes do **not** make MSYS/Cygwin compatible with restricted tokens. |
| 32 | `CreateFileMapping ... Win32 error 5` and the `cygheap_user::init` token-access |
| 33 | signature identify initialization denial; exit status 256 alone does not. |
| 34 | Native PowerShell can still launch an incompatible MSYS child. Ordinary command |
| 35 | failures therefore retain execution/may-be-partial semantics, even when an |
| 36 | external child reports initialization denial. No token flags, filesystem ACLs, |
| 37 | or sandbox enforcement are weakened by this change. |
| 38 | |
| 39 | 这些改动**尚未解决 MSYS/Cygwin 与受限令牌的兼容性**。映射创建错误和 cygheap 令牌 |
| 40 | 访问错误可识别初始化权限失败,但单独的退出码 256 不足以判断。PowerShell 仍可能调用 |
| 41 | 不兼容的 MSYS 子进程,所以业务命令中的此类失败仍按执行失败处理,不能声称整条命令 |
| 42 | 没有产生修改。本次改动不放宽令牌、文件权限或沙箱限制。 |
| 43 | |
| 44 | The restricted-token runner has since been removed: Windows commands start |
| 45 | directly as the current OS user, so the MSYS/Cygwin token incompatibility no |
| 46 | longer applies and the boundary above is historical context only. |
| 47 | |
| 48 | 受限令牌 runner 此后已被移除:Windows 命令直接以当前系统账户启动,MSYS/Cygwin |
| 49 | 与令牌的兼容性问题不再存在,上述边界仅作为历史背景保留。 |
| 50 |