CSI-u associated encoding is incorrect when Associated Text flag is on

Bug report

Detailed steps to reproduce the problem

  1. In a shell, run printf "\x1b[>31u && cat -v"
  2. Press any key which should generate text ("a", for example)

What happened

The key encoding for "a" is CSI 97 u

What should have happened

The associated text (as a codepoint) should be present: CSI 97 ; ; 97 u

Notes

I am reporting this on behalf of a user (I don't have a mac so I will have to be an intermediate for any debugging beyond what is available in this report). This was reported to have worked in 3.5.5 but broke in 3.5.6, and is broken in 3.5.11 still as well.

Every terminal I have tested which implements CSI-u encoding reports this key press as CSI 97 ; ; 97 u (foot, kitty, ghostty, alacritty). There are some minor differences in how key events or modifiers are reported (ie left blank for defaults or explicitly sent, semantically they all report the same event though)