Commit 38e8228
committed
fix(exec): address interactive TTY streaming review feedback
Server-side (sandbox.rs):
- Close SSH channel after EOF so PTY-backed programs (bash, vim, top)
terminate on client disconnect instead of leaking the session
- Break output loop when tx.send() fails (client gone) to tear down
the streaming pipeline promptly
- Default zero cols/rows to 80x24 before request_pty, matching the
proto "0 = use default" contract and preventing 1x1 terminals for
non-CLI clients
Client-side (run.rs):
- Replace spawn_blocking stdin reader with a detached std::thread so
the tokio runtime shutdown does not hang on a thread blocked in
stdin.read(). This removes the need for std::process::exit(),
allowing save_last_sandbox() in the caller to execute normally
- Switch from futures::channel::mpsc with try_send() to
tokio::sync::mpsc with blocking_send() for proper backpressure —
try_send silently stopped forwarding all input when the channel
filled during paste or slow network
- Add TaskGuard (abort-on-drop) for the resize task to ensure cleanup
on all return paths including early errors1 parent 54e6810 commit 38e8228
2 files changed
Lines changed: 88 additions & 68 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2741 | 2741 | | |
2742 | 2742 | | |
2743 | 2743 | | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
2744 | 2752 | | |
2745 | 2753 | | |
2746 | 2754 | | |
2747 | 2755 | | |
2748 | 2756 | | |
2749 | 2757 | | |
2750 | 2758 | | |
2751 | | - | |
2752 | 2759 | | |
| 2760 | + | |
2753 | 2761 | | |
2754 | 2762 | | |
2755 | 2763 | | |
2756 | | - | |
| 2764 | + | |
2757 | 2765 | | |
2758 | 2766 | | |
2759 | 2767 | | |
| |||
2774 | 2782 | | |
2775 | 2783 | | |
2776 | 2784 | | |
2777 | | - | |
| 2785 | + | |
2778 | 2786 | | |
2779 | 2787 | | |
2780 | 2788 | | |
| |||
2783 | 2791 | | |
2784 | 2792 | | |
2785 | 2793 | | |
2786 | | - | |
2787 | | - | |
2788 | | - | |
2789 | | - | |
2790 | | - | |
2791 | | - | |
2792 | | - | |
2793 | | - | |
2794 | | - | |
2795 | | - | |
2796 | | - | |
2797 | | - | |
2798 | | - | |
2799 | | - | |
2800 | | - | |
2801 | | - | |
2802 | | - | |
2803 | | - | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
2804 | 2820 | | |
2805 | | - | |
2806 | | - | |
| 2821 | + | |
| 2822 | + | |
2807 | 2823 | | |
2808 | 2824 | | |
2809 | 2825 | | |
2810 | | - | |
2811 | | - | |
2812 | | - | |
2813 | | - | |
2814 | | - | |
2815 | | - | |
2816 | | - | |
2817 | | - | |
2818 | | - | |
2819 | | - | |
2820 | | - | |
2821 | | - | |
2822 | | - | |
2823 | | - | |
2824 | | - | |
2825 | | - | |
2826 | | - | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
2827 | 2845 | | |
2828 | 2846 | | |
2829 | | - | |
2830 | | - | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
2831 | 2851 | | |
2832 | 2852 | | |
2833 | 2853 | | |
| |||
2853 | 2873 | | |
2854 | 2874 | | |
2855 | 2875 | | |
2856 | | - | |
2857 | | - | |
| 2876 | + | |
2858 | 2877 | | |
2859 | | - | |
| 2878 | + | |
2860 | 2879 | | |
2861 | 2880 | | |
2862 | | - | |
2863 | | - | |
2864 | | - | |
| 2881 | + | |
2865 | 2882 | | |
2866 | 2883 | | |
2867 | 2884 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | | - | |
1111 | | - | |
| 1110 | + | |
| 1111 | + | |
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
| |||
1565 | 1565 | | |
1566 | 1566 | | |
1567 | 1567 | | |
| 1568 | + | |
1568 | 1569 | | |
1569 | 1570 | | |
1570 | 1571 | | |
1571 | 1572 | | |
1572 | 1573 | | |
1573 | 1574 | | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | | - | |
1582 | | - | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
1583 | 1585 | | |
1584 | 1586 | | |
1585 | | - | |
1586 | | - | |
1587 | | - | |
1588 | | - | |
1589 | | - | |
1590 | | - | |
1591 | | - | |
1592 | | - | |
1593 | | - | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
1594 | 1597 | | |
1595 | 1598 | | |
1596 | 1599 | | |
| |||
0 commit comments