~rockorager/vaxis#22: 
OSC 11 responds in wrong order

Hi,

vaxis has a bit of an ordering problem with OSC 11.

My program expects that this:

$ printf '\033]11;0;?\a\033[c';read

will either

  • swallow OSC 11, then respond to primary device attributes (DA1)
  • bleed OSC 11, then respond to DA1 (I clear the screen so this is fine)
  • respond to OSC 11, then respond to DA1

The vaxis term widget (e.g. _examples/term/main.go, or aerc :term) exhibits a fourth behavior:

  • respond to DA1, then respond to OSC 11

This is problematic because I batch my queries on startup, and use the DA1 response as a sentinel between query response and user input. If I get DA1 before OSC 11, then I end up interpreting OSC 11 as user input.

I can (and will likely) modify my input loop to accomodate for this, but it's probably best to fix it here so that we can eventually rid the ecosystem of such kludges.

(ref. https://todo.sr.ht/~bptato/chawan/33)

Status
RESOLVED FIXED
Submitter
~bptato
Assigned to
No-one
Submitted
3 months ago
Updated
3 months ago
Labels
No labels applied.

~rockorager 3 months ago

Good catch...I see the issue already - when the terminal widget gets an OSC 11 query it queries the host terminal in a goroutine, and then responds. This will definitely get the ordering wrong.

This is problematic because I batch my queries on startup, and use the DA1 response as a sentinel between query response and user input. If I get DA1 before OSC 11, then I end up interpreting OSC 11 as user input.

I can (and will likely) modify my input loop to accomodate for this, but it's probably best to fix it here so that we can eventually rid the ecosystem of such kludges.

That sounds like it might cause issues elsewhere...I haven't seen any other terminals which would get this ordering wrong (I do queries in the same way). I'd caution against patching over this vaxis bug in your code...unless you have a nice way to do it which won't break other things :)

Thanks for the detailed report, I'll have this fixed shortly. Also...chawan is amazing, thanks for your work on it!

~rockorager REPORTED FIXED 3 months ago

Tim Culverhouse referenced this ticket in commit e2b805b.

~bptato 3 months ago

Oh, I didn't expect such a quick resolution. Thank you!

That sounds like it might cause issues elsewhere...I haven't seen any other terminals which would get this ordering wrong (I do queries in the same way).

I have, it's GNU screen, but out of laziness I just patched over it with a TERM check. I should at least post a bug report over there too...

Also...chawan is amazing, thanks for your work on it!

thanks :)

Register here or Log in to comment, or comment via email.