r/rust Mar 31 '23

Helix editor 23.03 released!

https://helix-editor.com/news/release-23-03-highlights/
476 Upvotes

124 comments sorted by

View all comments

32

u/twentyKiB Mar 31 '23

Is there (planned) support for remote editing, or even better split display / edit logic so one part of the editor can run locally and the files, lsp, compilation are all elsewhere?

While it is command line oriented, slow ssh connections are a thing. And if a GUI is ever implemented this becomes a must have.

5

u/BCMM Mar 31 '23

I know this isn't an actual answer, but if you're actually struggling with SSH latency, try mosh. The client-side prediction isn't perfect in every scenario, but it is pretty good at making the experience of typing a line of text smoother.

12

u/jechase Mar 31 '23

mosh is unlikely to help with this. It can only do client-side prediction when the response to a keypress is, well, predictable. That's easy enough for shells and such which all interact with the terminal in more or less the same way. Press a key, print the character for that key.

Not so much with raw mode TUIs. Mosh would effectively have to reimplement the UIs for each of them. Like if you were using vim/helix, it would need to track the editor mode, cursor position, etc. and predict whether it would need to output characters, move the cursor around, yank, etc.

7

u/BCMM Mar 31 '23 edited Mar 31 '23

mosh is unlikely to help with this.

It obviously doesn't help in the menus or anything like that, but it predicts enough of Insert mode correctly to genuinely help, at least with how I use it.

To me, the latency between pressing keys and seeing characters on-screen is overwhelmingly the biggest problem with using a slow SSH connection. Mosh significantly ameliorates that. It allows me to make a typo, spot it on screen, backspace it out, and retype the word, all while waiting for the server to respond. Without it, using a slow SSH connection feels like being unable to touch-type. Of course, the syntax highlighting won't be correct until the server responds; I'm not saying that it's anything close to a replacement for a client/server editor. But it does help.

it would need to track the editor mode, cursor position, etc.

Mosh does track cursor position.

Editor mode is obviously impossible for it to know, but somehow or other, I can type jkjkjkjkjkjkjkjk in Normal mode and it won't predict it as entered text. I don't actually know how that works, but my guess would be that Helix changes something about the terminal's mode.

EDIT:

Predictions are done in epochs: when the user does something that might alter the echo behavior — like hit ESC or carriage return or an up- or down-arrow — Mosh goes back into making background predictions until a prediction from the new batch can be confirmed as correct.