Repository navigation
Commit 00e4615
committed
Keep what a pipe process wrote before exiting early
When cmd2 captures a pipe process's output, as in a pyscript, that process
writes to pipes that a ProcReader reads. Only a pipe that was not the
terminal's job got its ProcReader after the startup check, so one that had
already exited was reported with RedirectionError without being read: what
it wrote, such as the shell's "command not found", was lost, and its pipes
were left for garbage collection to close. Create the ProcReader right
after the spawn for every pipe, and reap through it on the early exit.1 parent 984d3f2 commit 00e4615
3 files changed
Lines changed: 29 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3393 | 3393 | | |
3394 | 3394 | | |
3395 | 3395 | | |
| 3396 | + | |
3396 | 3397 | | |
3397 | | - | |
3398 | 3398 | | |
3399 | 3399 | | |
3400 | 3400 | | |
3401 | 3401 | | |
3402 | 3402 | | |
3403 | 3403 | | |
3404 | 3404 | | |
3405 | | - | |
| 3405 | + | |
3406 | 3406 | | |
3407 | 3407 | | |
3408 | 3408 | | |
| |||
3411 | 3411 | | |
3412 | 3412 | | |
3413 | 3413 | | |
3414 | | - | |
| 3414 | + | |
3415 | 3415 | | |
3416 | | - | |
3417 | | - | |
| 3416 | + | |
3418 | 3417 | | |
3419 | 3418 | | |
3420 | | - | |
3421 | | - | |
3422 | 3419 | | |
3423 | 3420 | | |
3424 | 3421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
982 | 982 | | |
983 | 983 | | |
984 | 984 | | |
| 985 | + | |
985 | 986 | | |
986 | 987 | | |
987 | 988 | | |
| |||
990 | 991 | | |
991 | 992 | | |
992 | 993 | | |
993 | | - | |
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
| |||
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
| 1014 | + | |
| 1015 | + | |
1014 | 1016 | | |
1015 | 1017 | | |
1016 | 1018 | | |
1017 | | - | |
1018 | 1019 | | |
1019 | 1020 | | |
1020 | 1021 | | |
| |||
1024 | 1025 | | |
1025 | 1026 | | |
1026 | 1027 | | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1027 | 1048 | | |
1028 | 1049 | | |
1029 | 1050 | | |
| |||
0 commit comments