Commit 87bf8b3
authored
Fix macOS hang in pipe operations by removing PTY terminal usage (#1382)
* Fix macOS hang in pipe operations by removing PTY terminal usage
- Remove PTY terminal creation in CommandOutputStream.open() method
- Use simple Java streams instead of TerminalBuilder for pipe operations
- Add unit test to verify pipe operations don't hang with timeout
- Clean up unused imports (TerminalBuilder, Attributes, InputFlag, etc.)
Fixes #1361 and #1360 where pipe operations would hang on macOS due to
PTY terminal creation. The fix follows the recommendation from PR #1367
discussion to use simple Java piped streams instead of PTY terminals
for command pipes.
The CommandOutputStream now reuses the original terminal for input and
uses redirected streams for output, avoiding the problematic PTY
terminal creation that caused hangs on BSD/macOS platforms.
* Fix variable assignment test syntax
- Use correct syntax 'variable=command' without spaces around equals
- Test now properly triggers CommandOutputStream.open() method
- Verifies that variable assignments don't hang on macOS with timeout1 parent 0ee349c commit 87bf8b3
File tree
2 files changed
+68
-28
lines changed- console/src
- main/java/org/jline/console/impl
- test/java/org/jline/console/impl
2 files changed
+68
-28
lines changedLines changed: 8 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | | - | |
44 | | - | |
45 | 41 | | |
46 | | - | |
47 | 42 | | |
48 | 43 | | |
49 | | - | |
50 | | - | |
51 | 44 | | |
52 | 45 | | |
53 | 46 | | |
| |||
494 | 487 | | |
495 | 488 | | |
496 | 489 | | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
515 | 495 | | |
516 | 496 | | |
517 | 497 | | |
518 | 498 | | |
519 | 499 | | |
520 | 500 | | |
521 | 501 | | |
522 | | - | |
| 502 | + | |
| 503 | + | |
523 | 504 | | |
524 | 505 | | |
525 | 506 | | |
526 | | - | |
| 507 | + | |
527 | 508 | | |
528 | 509 | | |
529 | 510 | | |
| |||
538 | 519 | | |
539 | 520 | | |
540 | 521 | | |
541 | | - | |
542 | 522 | | |
543 | 523 | | |
544 | 524 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
82 | 138 | | |
83 | 139 | | |
84 | 140 | | |
| |||
92 | 148 | | |
93 | 149 | | |
94 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
95 | 155 | | |
96 | 156 | | |
97 | 157 | | |
| |||
0 commit comments