Commit 1df6593
committed
util: handle stty failures under mingw for getpass workaround
When operating in a MinGW terminal without invoking `winpty`, getpass
does not function as expected. This extension included a workaround by
using `stty`; however, it has been observed in recent environments that
stty may fail to run. This would result in an exception and break a
user's attempt to perform a publish request.
First, this commit improves the handling when stty fails to invoke as
expected (instead of throwing exceptions a user may not understand).
Second, if stty, instead of falling back to trying `getpass` (which
seems to always never work in this environment), just stop and report
the issue. Users can should always be able to run with `winpty` to
prevent issues when using the ask-password capability.
Signed-off-by: James Knight <git@jdknight.me>1 parent 80ae2ee commit 1df6593
1 file changed
+18
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
337 | | - | |
338 | 338 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
344 | 355 | | |
345 | 356 | | |
346 | 357 | | |
| |||
0 commit comments