3 ms·
Related to mosh (mentioned in the article), something has been bouncing around my head a lot. Why don't terminal emulators already work the way mosh does, decou
by hackernudes 3y ago
Related to mosh (mentioned in the article), something has been bouncing around my head a lot. Why don't terminal emulators already work the way mosh does, decoupling the terminal part and the rendering part?
I assume it is possible to ingest a stream of terminal data much faster than rendering it (obviously keeping track of what is needed to render). Then the render loop can happen independently at a certain framerate, like a game engine. It is quite frustrating when a verbose 'cat' or 'find' slows my terminal emulator to a crawl drawing each line.
(edit: it just occurred to me that maybe this would break scroll-back in the terminal emulator... hmm)
- themk 3y agoMany terminal emulators do do this.
- dgl 3y agoSome terminals can do tricks like this, some terminal authors care about performance, e.g. https://codeberg.org/dnkl/foot/src/branch/master/doc/benchmark.md https://codeberg.org/dnkl/foot/src/branch/master/doc/benchma... In general you're better off using a terminal that performs better, because extra buffering would be annoying the other way around in the usual throughput/latency tradeoff (you'd press ^C and then it would continue to display what's in its buffer to you, rather than reacting quickly). What mosh brings is decoupling the rendering across the network. A lot of the poor perceived performance over high-latency links happens because ssh puts your terminal into raw mode, so even if the line is being echoed back, that is going all the way to the remote system and back again. It's actually possible to fix line editing in ssh, without using something like mosh, see for example https://github.com/hyc/OpenSSH-LINEMODE https://github.com/hyc/OpenSSH-LINEMODE. It's a shame OpenSSH hasn't merged something like those (now quite old) patches.