ish-app / ish

Linux shell for iOS
https://ish.app
Other
16.32k stars 855 forks source link

Fix bad timeout values in `pselect()` (which broke mosh) #2359

Closed cgull closed 3 months ago

cgull commented 3 months ago

mosh almost works, but it has weird unpredictable 1-30 second lag on text input that is quite incredibly annoying.

I ran this down to a fairly simple oversight: pselect() takes a timespec for the timeout value, but that was getting passed unchanged to the iSH select() implementation which takes a timeval.

It looks like a fix was made for #711 earlier that sort of worked; this probably fixes the real underlying problem with Emacs. That change clamped the excessively big nanosecond values to be +1 second, but Mosh was still badly affected.

This will probably clear up other mysterious lags in other applications.

There's a couple of other minor fixes I needed to get the CLI build working and logging, too.

tbodt commented 3 months ago

Thanks!