xterm: answer DSR 6 one-based; list the local patches

The cursor position report sent zero-based coordinates (the app's
terminal session overrides it with the same fix, which keeps working).
The vendored README now lists every local patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 23:39:00 +00:00
parent 2bcb62b5d8
commit fea34941d3
3 changed files with 26 additions and 10 deletions
@@ -52,6 +52,11 @@ void main() {
expect(t.buffer.cursorY, 3);
});
test('DSR 6 reports the one-based cursor position', () {
final t = FixtureTerminal()..feed('\x1b[3;7H\x1b[6n');
expect(t.takeReplies(), '\x1b[3;7R');
});
test('zero counts mean one', () {
final t = FixtureTerminal()..feed('\x1b[0C\x1b[0B');
expect(t.buffer.cursorX, 1);
+18 -9
View File
@@ -15,12 +15,21 @@ still compiles as part of every app build.
Local patches (keep this list current):
- colon-form SGR subparameters (`4:3`, `38:2::r:g:b`, `58`/`59`)
- DCS/APC/PM/SOS strings consumed rather than printed
- full RIS (`ESC c`) reset
- DECSCUSR cursor shapes, SCOSC/SCORC, CHT, CBT, HPA, HPR, VPR
- OSC 10/11/12 colour queries, OSC 8/52/7 callbacks
- alternate screen 1049 cursor restore, separate DECCKM mode
- mouse wheel, drag/motion and middle-button reporting; Shift selection override
- cursor and attribute rendering (inverse block cursor, strikethrough, conceal)
- focus reporting (`?1004`)
- CSI parsing: colon subparameters (`4:3`, `38:2::r:g:b`, `58`/`59`),
intermediates and private prefixes (`CSI > 4;2 m` is not SGR), empty
parameters as defaults; SGR 21 is double underline, 53/55 overline
- DCS/APC/PM/SOS strings consumed rather than printed; DECRQSS (`m`, `r`,
` q`) answered
- RIS (`ESC c`) full reset and DECSTR (`CSI ! p`)
- DECSCUSR cursor shapes (blinking is stored, not animated); SCOSC/SCORC,
CHT, CBT, HPA, HPR, VPR; HTS sets tab stops; DSR 6 one-based
- OSC 10/11/12 colour queries from the view's theme; OSC 8 links on cells
(`Terminal.hyperlinkAt`); OSC 52 set (`onClipboardSet`, no reads); OSC 7
(`onWorkingDirectoryChange`)
- alternate screen 1049 restores the cursor; arrow keys follow DECCKM
- mouse: wheel 64/65, screen-cell coordinates, drag (1002) and motion
(1003) reporting, middle button, Shift+drag selects
(`ui/mouse_listener.dart`)
- rendering: block cursor shows the character inverted, underline/bar
cursor position, strikethrough, conceal, overline, underline styles
- focus reporting (`?1004`, `Terminal.focusInput`, called by `TerminalView`)
+3 -1
View File
@@ -19,8 +19,10 @@ class EscapeEmitter {
return '\x1b[0n';
}
/// The CPR reply for the zero-based cursor ([x], [y]); the protocol is
/// one-based.
String cursorPosition(int x, int y) {
return '\x1b[$y;${x}R';
return '\x1b[${y + 1};${x + 1}R';
}
String bracketedPaste(String text) {