Commit 6ec4228
fix(cli): clearer Windows TUI error on Git Bash / MinTTY
GetConsoleMode only works on real Windows console handles. Git Bash,
MSYS and other MinTTY-based shells pipe stdio through the terminal
emulator instead of attaching a console, so the call fails with
ERROR_INVALID_HANDLE and the TUI aborts with a bare "GetConsoleMode
failed" message that leaves users at a dead end.
Detect that case via GetFileType: if the stdio handle returns
FILE_TYPE_PIPE the user is on MinTTY-piped stdio, so throw an
actionable IOException pointing at `winpty <command>` or the
terminals that do attach a real console (Windows Terminal,
PowerShell, cmd.exe).
Add a paragraph to docs/how-to.md under the TUI section covering
the same workaround so users finding the docs first don't trip
on it.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent cde845b commit 6ec4228
2 files changed
Lines changed: 33 additions & 0 deletions
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
194 | 198 | | |
195 | 199 | | |
196 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
197 | 213 | | |
198 | 214 | | |
199 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
128 | 145 | | |
129 | 146 | | |
130 | 147 | | |
| |||
0 commit comments