avose / GLShell

OpenGL Terminal
GNU Lesser General Public License v2.1
3 stars 0 forks source link

Fix Terminal Partial Escape Sequences #68

Open avose opened 1 year ago

avose commented 1 year ago

The terminal has code in place to take a partial escape sequence, and save the unparsed portion back to be handled later. This can happen if code writes out the sequence parts in chunks, and may even happen if things are slow or if there is lag in the input stream. I'm not 100% sure, because POSIX / Linux has some guarantees about the behavior of read() and write() system calls. That said, I'm not sure what Python wrappers are doing here.

However, if the term emulator code sees an escape character all alone, I think it will happily just skip over it as a possible escape sequence. Maybe this is something about not picking up lone escape key presses as escape sequences, since they are distinct. However, I think Python is a little slow, and I think it's possible that sometimes an escape sequence is missed because of this behavior. This puts Emacs in a bad state at times, I think, and breaks things.

I need to look into this further, and find a way to get single escapes and escape sequences properly handled.