FWIW, XTerm implements foot's current behavior. I.e. if we merge this, we will no longer match XTerm's emitted sequences.
Not sure if we should just blindly do what XTerm does, but it does mean we should think twice before merging this.
@craigbarnes I've been thinking this one over, and I don't see any reasons not to merge this. Any objections?
I can't think of any specific objections at the moment, but I do have some reservations about diverging from the xterm behavior. Since the CSI 27 ~ encoding scheme originates from xterm, it seems like subtly changing it could cause problems with existing clients, since they almost certainly implemented their support for it while testing against xterm.
Since all the various issues around shifted keys can be so confusing (and sometimes conflicting), I think we need to come up with a list of all the problems that should to be taken into account and be explicit about how changes like this would improve (or worsen) each of them.