Commit b521537
committed
fix: prefer Git for Windows bash.exe when available on Windows
Per @orhun's review on orhun#66: most users running terminal apps on Windows
want a POSIX shell so the Ratatui demos behave the same as on Linux/macOS.
The default-shell lookup now walks, in order:
1. `$SHELL` (already supported — useful when launching from Git Bash so
the inherited shell is honoured).
2. Git for Windows `bash.exe` in well-known install locations:
- `%ProgramW6432%\Git\{bin,usr/bin}\bash.exe`
- `%ProgramFiles%\Git\{bin,usr/bin}\bash.exe`
- `%ProgramFiles(x86)%\Git\{bin,usr/bin}\bash.exe`
- `%LOCALAPPDATA%\Programs\Git\{bin,usr/bin}\bash.exe`
3. `bash.exe` anywhere on `PATH` (covers scoop / chocolatey installs).
4. `%COMSPEC%` (typically resolves to `cmd.exe`).
5. Literal `cmd.exe` as the final fallback.
Verified on Windows 11 with Git for Windows installed at the default
location — `bash.exe` is now the spawned PTY child:
ProcessId : 204736
Name : bash.exe
CommandLine : "C:\Program Files\Git/bin/bash.exe"
Removing the Git install reverts to the `%COMSPEC%` / `cmd.exe` fallback
verified by the previous commit.1 parent 46cfe53 commit b521537
1 file changed
Lines changed: 56 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
194 | 200 | | |
195 | 201 | | |
196 | 202 | | |
| |||
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
202 | 256 | | |
203 | 257 | | |
204 | 258 | | |
| |||
0 commit comments