Sanskar Singh
cffc94a978
fix: prevent ClosePseudoConsole deadlock hanging PTY on Windows
...
ConPTY's ClosePseudoConsole can deadlock when it tries to flush output
to a pipe that nobody is reading (microsoft/terminal#1810 ). This caused
the PTY Promise to never resolve on Windows, making bash commands with
pty:true hang indefinitely.
Root cause: portable-pty's drop(master) calls ClosePseudoConsole
synchronously. If ConPTY's internal render thread is blocked writing to
a full/undrained output pipe, ClosePseudoConsole waits forever.
Fix (three parts):
1. Rust (pty.rs): Reordered teardown to follow Microsoft's recommended
shutdown sequence:
- Drop writer first (close ConPTY input pipe)
- Drain reader thread with 500ms timeout (consume output pipe)
- Drop master in a background thread with recv_timeout(2s):
* Clean case: ClosePseudoConsole completes, thread reclaimed
* Hung case: timeout expires, main thread returns anyway
- Replace child.wait() with try_wait() polling on Windows
(WaitForSingleObject can also hang in ConPTY)
2. TypeScript (bash-pty-selection.ts): Remove the Windows blanket
disable that prevented PTY from ever being used on Windows.
3. Tests: Updated to verify PTY works on Windows with UI context.
2026-05-16 07:02:24 +05:30
..
2026-05-15 18:31:12 +02:00
2026-05-12 04:09:33 +02:00
2026-05-15 05:03:58 +02:00
2026-05-12 10:01:56 +02:00
2026-05-12 11:15:38 +02:00
2026-05-15 17:49:35 +02:00
2026-04-30 18:08:37 +02:00
2026-05-14 06:53:21 +02:00
2026-05-13 06:00:45 +02:00
2026-05-13 05:22:41 +02:00
2026-05-12 04:09:33 +02:00
2026-03-14 10:46:26 +01:00
2026-05-15 18:49:53 +02:00
2026-05-12 04:09:33 +02:00
2026-05-14 06:12:41 +02:00
2026-05-12 04:09:33 +02:00
2026-05-16 00:20:00 +02:00
2026-05-15 17:49:00 +02:00
2026-05-12 04:09:33 +02:00
2026-05-16 07:02:24 +05:30
2026-05-13 13:21:59 +02:00
2026-04-18 22:36:33 +02:00
2026-05-16 00:20:00 +02:00
2026-05-16 00:20:00 +02:00
2026-05-13 06:00:45 +02:00
2026-05-13 06:00:45 +02:00
2026-05-14 03:26:25 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-03-14 11:25:40 +01:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-05-04 15:20:26 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 18:49:53 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-10 04:53:41 +02:00
2026-05-04 15:20:26 +02:00
2026-04-01 14:53:28 +07:00
2026-05-03 08:17:09 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-05-14 05:35:16 +02:00
2026-05-16 00:20:00 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-05-12 04:09:33 +02:00
2026-04-23 21:02:14 +02:00
2026-05-12 05:53:18 +02:00
2026-03-14 11:25:40 +01:00
2026-04-30 15:14:07 +02:00
2026-05-14 04:36:19 +02:00
2026-05-02 07:01:57 +02:00
2026-05-02 03:31:27 +02:00
2026-05-13 06:00:45 +02:00
2026-04-10 14:51:27 -05:00
2026-04-13 04:24:59 +02:00
2026-05-14 04:36:19 +02:00
2026-05-12 04:09:33 +02:00
2026-03-01 09:55:02 +01:00
2026-05-14 05:35:16 +02:00
2026-03-03 06:07:22 +01:00
2026-03-03 06:07:22 +01:00
2026-04-02 07:35:44 +02:00
2026-05-15 02:25:07 +00:00
2026-03-11 00:03:48 +01:00
2026-05-15 15:16:50 +02:00
2026-05-04 15:20:26 +02:00
2026-05-15 18:31:12 +02:00
2026-05-04 15:20:26 +02:00
2026-05-15 18:31:12 +02:00
2026-05-14 04:36:19 +02:00
2026-05-14 04:36:19 +02:00
2026-03-03 14:45:06 +01:00
2026-04-08 18:52:42 +02:00
2026-05-06 17:13:11 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 09:37:24 +02:00
2026-05-14 04:36:19 +02:00
2026-05-12 04:09:33 +02:00
2026-05-13 08:18:07 +00:00
2026-05-06 19:01:21 +02:00
2026-02-28 06:33:07 +01:00
2026-05-14 04:36:19 +02:00
2026-02-13 14:07:38 +01:00
2026-05-14 04:36:19 +02:00
2026-04-11 08:54:27 +02:00
2026-02-16 10:08:53 +01:00
2026-05-14 04:36:19 +02:00
2026-05-03 09:48:11 +02:00
2026-05-03 09:48:11 +02:00
2026-05-03 09:48:11 +02:00
2026-05-14 04:36:19 +02:00
2026-05-12 08:22:46 +02:00
2026-04-23 21:02:14 +02:00
2026-04-27 18:21:45 +01:00
2026-03-03 15:09:46 +01:00
2026-03-03 15:12:50 +01:00
2026-05-12 04:09:33 +02:00
2026-05-13 13:21:59 +02:00
2026-04-08 14:42:51 +02:00
2026-03-22 18:28:40 +01:00
2026-04-30 18:08:37 +02:00
2026-05-04 00:19:06 +02:00
2026-05-14 05:35:16 +02:00
2026-05-14 04:36:19 +02:00
2026-05-14 04:36:19 +02:00
2026-05-14 05:33:30 +02:00
2026-04-28 05:23:26 +02:00
2026-05-04 15:20:26 +02:00
2026-05-14 04:36:19 +02:00
2026-05-04 00:19:06 +02:00
2026-05-14 04:36:19 +02:00
2026-04-30 04:51:23 +02:00
2026-04-30 04:51:23 +02:00
2026-04-30 04:51:23 +02:00
2026-05-02 07:55:30 +02:00
2026-05-02 07:48:30 +02:00
2026-05-14 04:36:19 +02:00
2026-05-14 06:23:55 +02:00
2026-05-09 03:11:19 +02:00
2026-05-09 03:11:18 +02:00
2026-05-09 04:02:20 +02:00
2026-05-10 03:21:02 +08:00
2026-05-10 05:09:29 +02:00
2026-05-10 04:55:43 +02:00
2026-05-12 06:56:39 +02:00
2026-05-15 18:31:12 +02:00
2026-05-13 01:56:18 +02:00
2026-04-02 07:35:44 +02:00
2026-03-22 18:28:40 +01:00
2026-04-26 06:59:47 +02:00
2026-03-26 15:33:26 +01:00
2026-05-12 04:09:33 +02:00
2026-05-07 15:40:45 +02:00
2026-05-14 06:40:41 +02:00
2026-03-03 04:00:30 +01:00
2026-03-20 23:48:38 +01:00
2026-05-12 04:09:33 +02:00
2026-03-03 06:07:22 +01:00
2026-04-30 15:04:33 +02:00
2026-05-03 07:39:52 +02:00
2026-03-14 11:00:07 +01:00
2026-05-14 04:36:19 +02:00
2026-04-13 00:58:32 +02:00
2026-05-12 04:09:33 +02:00
2026-05-15 15:16:50 +02:00
2026-04-13 15:46:06 +02:00
2026-05-12 04:09:33 +02:00
2026-03-08 16:16:54 +01:00
2026-05-13 15:39:04 -07:00
2026-02-23 06:21:32 +00:00
2026-05-15 00:03:57 +02:00
2026-05-04 15:20:26 +02:00
2026-05-12 04:09:33 +02:00
2026-05-11 00:05:00 +00:00
2026-05-07 15:06:39 -03:00
2026-05-14 06:40:50 +02:00
2026-05-12 04:09:33 +02:00
2026-05-13 06:00:45 +02:00
2026-05-14 05:58:25 +02:00
2026-05-14 23:22:27 +02:00
2026-05-13 04:05:23 +02:00
2026-05-13 05:24:33 +02:00
2026-05-14 04:36:19 +02:00
2026-03-26 19:12:51 +01:00
2026-05-02 01:57:19 +02:00
2026-02-20 12:28:25 +01:00
2026-01-28 21:12:28 +01:00
2026-04-08 06:23:27 +02:00
2026-05-15 01:00:06 +02:00
2026-03-06 12:35:01 +01:00
2026-05-13 05:33:03 +02:00
2026-05-15 14:46:54 +02:00
2026-04-08 08:47:32 +02:00
2026-05-04 18:06:12 +02:00
2026-04-23 21:02:14 +02:00
2026-05-15 14:46:54 +02:00
2026-05-12 04:09:33 +02:00
2026-05-15 17:00:18 +02:00
2026-05-14 05:03:04 +02:00
2026-03-02 17:01:44 +01:00
2026-03-26 16:17:27 +01:00
2026-05-14 04:36:19 +02:00
2026-05-14 05:12:07 +02:00
2026-05-13 23:58:13 +00:00
2026-03-13 15:14:05 +01:00
2026-05-12 04:09:33 +02:00
2026-05-14 06:23:55 +02:00
2026-05-15 17:49:14 +02:00
2026-03-03 14:32:02 +01:00
2026-04-18 23:24:00 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-02-15 10:20:11 +01:00
2026-05-04 15:20:26 +02:00
2026-05-15 14:46:54 +02:00
2026-02-15 10:20:11 +01:00
2026-04-07 02:00:59 +02:00
2026-05-12 04:09:33 +02:00
2026-05-15 23:46:23 +02:00
2026-02-01 10:23:41 +01:00
2026-02-18 01:53:02 +01:00
2026-03-26 19:12:50 +01:00
2026-05-14 04:36:19 +02:00
2026-05-14 04:36:19 +02:00
2026-01-29 10:47:55 +01:00
2026-05-10 07:59:53 +02:00
2026-05-13 06:00:45 +02:00