wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.99k stars 807 forks source link

Wezterm ssh closes after some time with "error reading from channel", using libssh backend #4023

Open j-xella opened 1 year ago

j-xella commented 1 year ago

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20230408-112425-69ae8472 x86_64-pc-windows-msvc

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

No, and I'll explain why below

Describe the bug

I use Wezterm on Windows to connect to Linux via ssh. Wezterm runs for a while (an hour or 2), then closes spontaneously. Running with DEBUG enabled produces logs like this:

16:15:48.115  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1663, 718), screen_coords: (4663, 363), mouse_buttons: NONE, modifiers: NONE })
16:15:48.136  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1656, 720), screen_coords: (4656, 365), mouse_buttons: NONE, modifiers: NONE })
16:15:48.139  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1656, 720), screen_coords: (4656, 365), mouse_buttons: NONE, modifiers: NONE })
16:15:48.142  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1654, 720), screen_coords: (4654, 365), mouse_buttons: NONE, modifiers: NONE })
16:15:48.159  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1649, 721), screen_coords: (4649, 366), mouse_buttons: NONE, modifiers: NONE })
16:15:48.164  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1649, 721), screen_coords: (4649, 366), mouse_buttons: NONE, modifiers: NONE })
16:15:48.173  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1646, 721), screen_coords: (4646, 366), mouse_buttons: NONE, modifiers: NONE })
16:15:48.185  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1644, 721), screen_coords: (4644, 366), mouse_buttons: NONE, modifiers: NONE })
16:15:48.195  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1644, 721), screen_coords: (4644, 366), mouse_buttons: NONE, modifiers: NONE })
16:15:48.226  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1642, 722), screen_coords: (4642, 367), mouse_buttons: NONE, modifiers: NONE })
16:15:48.251  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1641, 722), screen_coords: (4641, 367), mouse_buttons: NONE, modifiers: NONE })
16:15:48.263  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1639, 722), screen_coords: (4639, 367), mouse_buttons: NONE, modifiers: NONE })
16:15:48.288  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1637, 723), screen_coords: (4637, 368), mouse_buttons: NONE, modifiers: NONE })
16:15:48.300  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1636, 723), screen_coords: (4636, 368), mouse_buttons: NONE, modifiers: NONE })
16:15:48.315  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1635, 723), screen_coords: (4635, 368), mouse_buttons: NONE, modifiers: NONE })
16:15:48.336  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1633, 723), screen_coords: (4633, 368), mouse_buttons: NONE, modifiers: NONE })
16:15:48.364  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1631, 723), screen_coords: (4631, 368), mouse_buttons: NONE, modifiers: NONE })
16:15:48.374  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1630, 724), screen_coords: (4630, 369), mouse_buttons: NONE, modifiers: NONE })
16:15:48.390  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1629, 724), screen_coords: (4629, 369), mouse_buttons: NONE, modifiers: NONE })
16:15:48.414  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1629, 725), screen_coords: (4629, 370), mouse_buttons: NONE, modifiers: NONE })
16:15:48.439  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1628, 725), screen_coords: (4628, 370), mouse_buttons: NONE, modifiers: NONE })
16:15:48.469  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1627, 725), screen_coords: (4627, 370), mouse_buttons: NONE, modifiers: NONE })
16:15:48.486  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1621, 728), screen_coords: (4621, 373), mouse_buttons: NONE, modifiers: NONE })
16:15:48.496  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1613, 733), screen_coords: (4613, 378), mouse_buttons: NONE, modifiers: NONE })
16:15:48.515  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1592, 744), screen_coords: (4592, 389), mouse_buttons: NONE, modifiers: NONE })
16:15:48.537  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1563, 760), screen_coords: (4563, 405), mouse_buttons: NONE, modifiers: NONE })
16:15:48.543  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1547, 769), screen_coords: (4547, 414), mouse_buttons: NONE, modifiers: NONE })
16:15:48.560  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1508, 791), screen_coords: (4508, 436), mouse_buttons: NONE, modifiers: NONE })
16:15:48.582  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1454, 820), screen_coords: (4454, 465), mouse_buttons: NONE, modifiers: NONE })
16:15:48.582  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1449, 822), screen_coords: (4449, 467), mouse_buttons: NONE, modifiers: NONE })
16:15:48.591  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1425, 835), screen_coords: (4425, 480), mouse_buttons: NONE, modifiers: NONE })
16:15:48.612  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1382, 858), screen_coords: (4382, 503), mouse_buttons: NONE, modifiers: NONE })
16:15:48.622  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1364, 866), screen_coords: (4364, 511), mouse_buttons: NONE, modifiers: NONE })
16:15:48.642  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1339, 878), screen_coords: (4339, 523), mouse_buttons: NONE, modifiers: NONE })
16:15:48.883  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1328, 883), screen_coords: (4328, 528), mouse_buttons: NONE, modifiers: NONE })
16:15:48.888  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1327, 883), screen_coords: (4327, 528), mouse_buttons: NONE, modifiers: NONE })
16:15:48.904  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1311, 883), screen_coords: (4311, 528), mouse_buttons: NONE, modifiers: NONE })
16:15:48.920  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1238, 874), screen_coords: (4238, 519), mouse_buttons: NONE, modifiers: NONE })
16:15:48.933  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (1101, 855), screen_coords: (4101, 500), mouse_buttons: NONE, modifiers: NONE })
16:15:48.956  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (803, 812), screen_coords: (3803, 457), mouse_buttons: NONE, modifiers: NONE })
16:15:48.957  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (770, 808), screen_coords: (3770, 453), mouse_buttons: NONE, modifiers: NONE })
16:15:48.965  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (596, 798), screen_coords: (3596, 443), mouse_buttons: NONE, modifiers: NONE })
16:15:48.985  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (301, 797), screen_coords: (3301, 442), mouse_buttons: NONE, modifiers: NONE })
16:15:49.006  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (147, 794), screen_coords: (3147, 439), mouse_buttons: NONE, modifiers: NONE })
16:15:49.016  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (111, 790), screen_coords: (3111, 435), mouse_buttons: NONE, modifiers: NONE })
16:15:49.031  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (88, 786), screen_coords: (3088, 431), mouse_buttons: NONE, modifiers: NONE })
16:15:49.051  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (78, 781), screen_coords: (3078, 426), mouse_buttons: NONE, modifiers: NONE })
16:15:49.060  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (77, 780), screen_coords: (3077, 425), mouse_buttons: NONE, modifiers: NONE })
16:15:49.079  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (77, 778), screen_coords: (3077, 423), mouse_buttons: NONE, modifiers: NONE })
16:15:49.099  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (78, 772), screen_coords: (3078, 417), mouse_buttons: NONE, modifiers: NONE })
16:15:49.108  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (80, 768), screen_coords: (3080, 413), mouse_buttons: NONE, modifiers: NONE })
16:15:49.126  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (88, 760), screen_coords: (3088, 405), mouse_buttons: NONE, modifiers: NONE })
16:15:49.146  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (101, 748), screen_coords: (3101, 393), mouse_buttons: NONE, modifiers: NONE })
16:15:49.156  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (111, 740), screen_coords: (3111, 385), mouse_buttons: NONE, modifiers: NONE })
16:15:49.176  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (145, 718), screen_coords: (3145, 363), mouse_buttons: NONE, modifiers: NONE })
16:15:49.186  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (167, 705), screen_coords: (3167, 350), mouse_buttons: NONE, modifiers: NONE })
16:15:49.205  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (214, 675), screen_coords: (3214, 320), mouse_buttons: NONE, modifiers: NONE })
16:15:49.216  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (235, 663), screen_coords: (3235, 308), mouse_buttons: NONE, modifiers: NONE })
16:15:49.236  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (264, 644), screen_coords: (3264, 289), mouse_buttons: NONE, modifiers: NONE })
16:15:49.248  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (276, 636), screen_coords: (3276, 281), mouse_buttons: NONE, modifiers: NONE })
16:15:49.262  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (285, 630), screen_coords: (3285, 275), mouse_buttons: NONE, modifiers: NONE })
16:15:49.371  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (287, 628), screen_coords: (3287, 273), mouse_buttons: NONE, modifiers: NONE })
16:15:49.454  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (288, 628), screen_coords: (3288, 273), mouse_buttons: NONE, modifiers: NONE })
16:15:49.460  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (288, 630), screen_coords: (3288, 275), mouse_buttons: NONE, modifiers: NONE })
16:15:49.468  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (290, 636), screen_coords: (3290, 281), mouse_buttons: NONE, modifiers: NONE })
16:15:49.488  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (302, 665), screen_coords: (3302, 310), mouse_buttons: NONE, modifiers: NONE })
16:15:49.497  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (313, 685), screen_coords: (3313, 330), mouse_buttons: NONE, modifiers: NONE })
16:15:49.518  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (340, 724), screen_coords: (3340, 369), mouse_buttons: NONE, modifiers: NONE })
16:15:49.528  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (351, 738), screen_coords: (3351, 383), mouse_buttons: NONE, modifiers: NONE })
16:15:49.548  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (365, 757), screen_coords: (3365, 402), mouse_buttons: NONE, modifiers: NONE })
16:15:49.568  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (372, 769), screen_coords: (3372, 414), mouse_buttons: NONE, modifiers: NONE })
16:15:49.578  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (373, 771), screen_coords: (3373, 416), mouse_buttons: NONE, modifiers: NONE })
16:15:49.628  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (371, 770), screen_coords: (3371, 415), mouse_buttons: NONE, modifiers: NONE })
16:15:49.638  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (366, 765), screen_coords: (3366, 410), mouse_buttons: NONE, modifiers: NONE })
16:15:49.658  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (356, 755), screen_coords: (3356, 400), mouse_buttons: NONE, modifiers: NONE })
16:15:49.679  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (346, 737), screen_coords: (3346, 382), mouse_buttons: NONE, modifiers: NONE })
16:15:49.689  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (342, 727), screen_coords: (3342, 372), mouse_buttons: NONE, modifiers: NONE })
16:15:49.708  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (332, 706), screen_coords: (3332, 351), mouse_buttons: NONE, modifiers: NONE })
16:15:49.718  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (328, 698), screen_coords: (3328, 343), mouse_buttons: NONE, modifiers: NONE })
16:15:49.738  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (319, 685), screen_coords: (3319, 330), mouse_buttons: NONE, modifiers: NONE })
16:15:49.748  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (316, 680), screen_coords: (3316, 325), mouse_buttons: NONE, modifiers: NONE })
16:15:49.762  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (313, 675), screen_coords: (3313, 320), mouse_buttons: NONE, modifiers: NONE })
16:15:49.778  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (310, 670), screen_coords: (3310, 315), mouse_buttons: NONE, modifiers: NONE })
16:15:49.797  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (307, 663), screen_coords: (3307, 308), mouse_buttons: NONE, modifiers: NONE })
16:15:49.817  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (304, 659), screen_coords: (3304, 304), mouse_buttons: NONE, modifiers: NONE })
16:15:49.827  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (303, 657), screen_coords: (3303, 302), mouse_buttons: NONE, modifiers: NONE })
16:15:49.847  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (302, 653), screen_coords: (3302, 298), mouse_buttons: NONE, modifiers: NONE })
16:15:49.858  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (301, 650), screen_coords: (3301, 295), mouse_buttons: NONE, modifiers: NONE })
16:15:49.878  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (300, 642), screen_coords: (3300, 287), mouse_buttons: NONE, modifiers: NONE })
16:15:49.888  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (300, 636), screen_coords: (3300, 281), mouse_buttons: NONE, modifiers: NONE })
16:15:49.910  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (303, 621), screen_coords: (3303, 266), mouse_buttons: NONE, modifiers: NONE })
16:15:49.928  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (313, 604), screen_coords: (3313, 249), mouse_buttons: NONE, modifiers: NONE })
16:15:49.938  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (319, 595), screen_coords: (3319, 240), mouse_buttons: NONE, modifiers: NONE })
16:15:49.950  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (326, 586), screen_coords: (3326, 231), mouse_buttons: NONE, modifiers: NONE })
16:15:49.966  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (336, 575), screen_coords: (3336, 220), mouse_buttons: NONE, modifiers: NONE })
16:15:49.982  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (345, 565), screen_coords: (3345, 210), mouse_buttons: NONE, modifiers: NONE })
16:15:50.002  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (351, 559), screen_coords: (3351, 204), mouse_buttons: NONE, modifiers: NONE })
16:15:50.023  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (355, 556), screen_coords: (3355, 201), mouse_buttons: NONE, modifiers: NONE })
16:15:50.038  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (355, 554), screen_coords: (3355, 199), mouse_buttons: NONE, modifiers: NONE })
16:15:50.143  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (356, 553), screen_coords: (3356, 198), mouse_buttons: NONE, modifiers: NONE })
16:15:50.149  DEBUG  wezterm_gui::termwindow                > FocusChanged(true)
16:15:50.150  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Press(Left), coords: (356, 553), screen_coords: (3356, 198), mouse_buttons: LEFT, modifiers: NONE })
16:15:50.151  DEBUG  wezterm_gui::termwindow                > Notification(Any { .. })
16:15:50.151  DEBUG  wezterm_gui::termwindow                > Notification(Any { .. })
16:15:50.151  DEBUG  wezterm_gui::termwindow                > Notification(Any { .. })
16:15:50.151  DEBUG  wezterm_gui::termwindow                > Notification(Any { .. })
16:15:50.152  DEBUG  wezterm_gui::termwindow                > NeedRepaint
16:15:50.171  DEBUG  wezterm_gui::termwindow::render::paint > paint_impl before call_draw elapsed=19.3759ms
16:15:50.173  DEBUG  wezterm_gui::termwindow::render::paint > paint_impl elapsed=21.191ms, fps=0.01748139
16:15:50.174  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (356, 553), screen_coords: (3356, 198), mouse_buttons: LEFT, modifiers: NONE })
16:15:50.207  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Release(Left), coords: (356, 553), screen_coords: (3356, 198), mouse_buttons: NONE, modifiers: NONE })
16:15:50.207  DEBUG  wezterm_gui::termwindow                > NeedRepaint
16:15:50.211  DEBUG  wezterm_gui::termwindow::render::paint > paint_impl before call_draw elapsed=4.2883ms
16:15:50.213  DEBUG  wezterm_gui::termwindow::render::paint > paint_impl elapsed=5.6174ms, fps=0.01748139
16:15:50.226  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (356, 553), screen_coords: (3356, 198), mouse_buttons: NONE, modifiers: NONE })
16:15:50.309  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (357, 553), screen_coords: (3357, 198), mouse_buttons: NONE, modifiers: NONE })
16:15:50.332  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (363, 556), screen_coords: (3363, 201), mouse_buttons: NONE, modifiers: NONE })
16:15:50.348  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (369, 559), screen_coords: (3369, 204), mouse_buttons: NONE, modifiers: NONE })
16:15:50.358  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (372, 561), screen_coords: (3372, 206), mouse_buttons: NONE, modifiers: NONE })
16:15:50.377  DEBUG  wezterm_gui::termwindow                > MouseEvent(MouseEvent { kind: Move, coords: (378, 565), screen_coords: (3378, 210), mouse_buttons: NONE, modifiers: NONE })
16:15:50.377  DEBUG  mux                                    > removing pane 0
16:15:50.377  DEBUG  mux                                    > killing pane 0
16:15:50.377  DEBUG  mux::localpane                         > killing process in pane 0, state is Running { child_waiter: Receiver { .. }, pid: None, signaller: WrappedSshChildKiller { inner: Mutex { data: KillerInner { killer: Some(SshChildKiller { tx: Some(SessionSender { tx: Sender { .. }, pipe: Mutex { data: FileDescriptor { handle: OwnedHandle { handle: 0x2e0, handle_type: Socket } }, poisoned: false, .. } }), channel: 1 }), pending_kill: false }, poisoned: false, .. } }, killed: false }
16:15:50.377  DEBUG  mux                                    > removing pane 2
16:15:50.377  DEBUG  mux                                    > killing pane 2
16:15:50.377  DEBUG  mux::localpane                         > killing process in pane 2, state is Running { child_waiter: Receiver { .. }, pid: None, signaller: SshChildKiller { tx: Some(SessionSender { tx: Sender { .. }, pipe: Mutex { data: FileDescriptor { handle: OwnedHandle { handle: 0x2e0, handle_type: Socket } }, poisoned: false, .. } }), channel: 2 }, killed: false }
16:15:50.380  DEBUG  wezterm_ssh::sessioninner              > error reading from channel 1 stdin pipe: EOF
16:15:50.383  DEBUG  wezterm_ssh::sessioninner              > error reading from channel 2 stdin pipe: EOF

To Reproduce

Not sure how ... I just work, and after a while wezterm closes... Maybe logs can give a hint?

Wezterm is running on a PC that I RDP to. Several times I would lock the PC, and when I unlock it, wezterm is gone. Or, wezterm disappears when I switch focus back to it, often by clicking it with a mouse. But, obviously, it does not happen every time...

Configuration

config.hide_tab_bar_if_only_one_tab = true

config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"

config.window_frame = {
  border_left_width = 1,
  border_right_width = 1,
  border_bottom_height = 1,
  border_top_height = 1,
  border_left_color = 'silver',
  border_right_color = 'silver',
  border_bottom_color = 'silver',
  border_top_color = 'silver',
}

config.window_padding = {
  left = 3,
  -- right = 3,
  top = 3,
  bottom = 3,
}

config.enable_scroll_bar = true
-- How many lines of scrollback you want to retain per tab
config.scrollback_lines = 10000

config.cursor_blink_rate = 1000
config.cursor_blink_ease_in = "Ease"
config.cursor_blink_ease_out = "Constant"
config.default_cursor_style = 'BlinkingBlock'
-- config.cursor_thickness = "200%"

--[[ config.colors = {
  cursor_bg = '#005500',
  cursor_fg = 'white',
} --]]

config.front_end = 'WebGpu' -- works much faster via RDP, see also https://github.com/wez/wezterm/issues/2876
config.webgpu_power_preference = 'HighPerformance'

Expected Behavior

Wezterm does not die.

Logs

Debug Overlay wezterm version: 20230408-112425-69ae8472 x86_64-pc-windows-msvc Window Environment: Windows OpenGL version: WebGPU: name=Quadro P400, device_type=DiscreteGpu, backend=Vulkan, driver=NVIDIA, driver_info=527.48, vendor=4318, device=7347 Enter lua statements or expressions and hit Enter.

Anything else?

No response

wez commented 1 year ago

is it a wezterm ssh instance that goes away? Most likely cause is that the ssh connection times out and gets shut down. Try setting exit_behavior = "Hold" to see if that helps to explain what happened

j-xella commented 1 year ago

Yes, I have a host configured in %USERPROFILE%/.ssh/config, and then invoke wezterm-gui ssh myhost. Using your suggestion, I got the following error:

⚠️  Process RemoteSshDomain didn't exit cleanly
Exited with code 1.
This message is shown because exit_behavior="Hold"

The error appeared in the middle of the screen, but I guess this is because I had a neovim session open, and that is where the cursor was at the moment.

I left the session running overnight, so can't say exactly how long it took to fail. There is nothing in the logs about the failure, unless you run with DEBUG mode. In DEBUG mode, the logs can become huge, so I don't run in DEBUG mode every time. I think it would help if this error message on screen also contained timestamp, so that it would be possible to determine when wezterm closed. And if something would be written to the logs on such occasion even if running without WEZTERM_LOG=debug.

This problem never happened when I was using Putty, but I always have keepalive enabled. I have looked around and for OpenSSH this would enable automatic keep-alive pinging:

Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2

Does libssh support these options, and if not, what is the alternative?

j-xella commented 1 year ago

OK, the ServerAlive* options in SSH config file did not make any difference.

I have now opened a new workspace for the same ssh connection, and started a command in it that would constantly generate some output. Something like watch -n 5 date. Let's see if this will prevent wezterm from closing.

j-xella commented 1 year ago

SSH connection seems to get interrupted even when I am working - so this is unlikely to be a timeout issue due to inactivity.

Out of desperation, I have tried restarting my PC. This also does not seem to prevent the problem from reappearing.

I have also tried to start a putty connection to the same user@host, and leave it in the background. It does not fail when wezterm connection fails. Just in case this is some sort of my local network issue....

Then I started wezterm ssh -v myhost . This enabled the whole new set of debug messages, with socket exception:

17:18:36.301  INFO   libssh::ssh_packet_newkeys             > Received SSH_MSG_NEWKEYS
17:18:36.303  INFO   libssh::ssh_packet_newkeys             > Signature verified and valid
17:18:36.305  INFO   libssh::ssh_packet_set_newkeys         > This direction isn't used anymore.
17:18:36.308  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:36.417  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:36.420  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:36.620  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:36.622  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:37.026  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:37.028  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:37.839  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:37.843  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:39.448  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:39.450  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:42.651  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:42.653  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:49.058  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:49.062  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:54.142  INFO   libssh::ssh_socket_unbuffered_write    > Enabling POLLOUT for socket
17:18:54.144  INFO   libssh::packet_send2                   > packet: wrote [type=94, len=28, padding_size=15, comp=12, payload=12]
17:18:54.148  INFO   libssh::channel_write_common           > channel_write wrote 3 bytes
17:18:54.152  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:54.153  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:54.154  INFO   libssh::ssh_packet_need_rekey          > rekey: [data_rekey_needed=0, out_blocks=1, in_blocks=1]
17:18:54.155  INFO   libssh::ssh_socket_unbuffered_write    > Enabling POLLOUT for socket
17:18:54.156  INFO   libssh::packet_send2                   > packet: wrote [type=94, len=28, padding_size=6, comp=21, payload=21]
17:18:54.158  INFO   libssh::channel_write_common           > channel_write wrote 12 bytes
17:18:54.159  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:54.160  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:54.179  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360
17:18:54.181  INFO   libssh::ssh_socket_exception_callback  > Socket exception callback: 2 (10054)
17:18:54.181  INFO   libssh::ssh_socket_exception_callback  > Socket error: Unknown error
17:18:54.182  INFO   libssh::ssh_channel_read_timeout       > Read (8192) buffered : 0 bytes. Window: 793360

I am beginning to suspect that libssh shipped with wezterm does not work properly on Windows ....

wez commented 1 year ago

the exception error code 10054 is WSAECONNRESET:

Connection reset by peer. An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.

j-xella commented 1 year ago

Following the idea that libssh is not behaving correctly, I restarted Wezterm with

config.ssh_backend = "Ssh2"

This seems to solve (or, rather, bypass) the issue for me - Wezterm is staying on for more than 24h so far.

To be fair, I have tried connecting to the same user@host from different Windows PC, and Wezterm works normally even with libssh backend. So there is something on this particular PC that makes libssh fail. And it is likely not easy to reproduce...

If there is any way to gather more insight into this issue, please let me know. Otherwise, I will maybe give libssh a go once wezterm is deployed with a newer version of it.

Hammit commented 4 months ago

I have come across the same problem and the solution works for me. I have WezTerm installed in Windows and I have a .ssh/config file with the relevant keepalive options, but they seem to be ignored by libssh. Switching to Ssh2 backend works, but degrades the experience as I need interactivity when keys become invalid.