ok, at least on my side, the problem here is that we're running in kitty but exporting TERM=xterm-256color. we then get a bunch of kitty-style responses to our terminal queries, and don't know what to do with them. eventually we bomb out with:
EINVAL:Zero width/height not allowed looking into this further...we added that TERM export to deal with some other autopkgtests issue, as i recall.

