shell plugin doubles rendering of keystrokes
josephholsten opened this issue · 1 comments
When I start the Shell
plugin, and start typing, I get doubled keystrokes with a little bit of a delay.
For example, if I type pwd
quickly, it renders pwdpwd
.
but if I type whoami
relatively slowly, it renders whowhoamiami
Potentially related, I got the following errors on my console:
Requesting rerenderRequesting rerenderInvalid rune -1 from key.Event{(CodeLeftControl), key.Modifiers(Control), key.Direction(10)}
Requesting rerenderInvalid rune -1 from key.Event{(CodeLeftControl), key.Modifiers(), key.Direction(11)}
Requesting rerenderRequesting rerenderInvalid rune -1 from key.Event{(CodeLeftControl), key.Modifiers(Control), key.Direction(10)}
Requesting rerenderInvalid rune -1 from key.Event{(CodeLeftControl), key.Modifiers(), key.Direction(11)}
Requesting rerenderRequesting rerenderRequesting rerenderRequesting rerenderRequesting rerenderRequesting rerenderInvalid rune -1 from key.Event{(CodeLeftGUI), key.Modifiers(Meta), key.Direction(10)}
Invalid rune -1 from key.Event{(CodeLeftGUI), key.Modifiers(), key.Direction(11)}
Requesting rerender
I note that some of these log message are missing newlines.
I should probably put a note somewhere that the shell plugin is still experimental. The error messages are just for my own debugging and can be commented out.
The plugin is adding the character to the end of the buffer, and some shells also echo the character typed back, while other shells don't. I haven't figured out how to ensure that all shells act consistently yet. (I can't set any tty options because there is no tty.)
For the delay: try changing the time.Sleep in shell.go which makes sure it doesn't suck all the CPU resources reading EOF from 300 milliseconds to something smaller (100 seems to feel much more responsive.)