Terminal: xterm key encoding, no live reflow on resize, Alt+T/Ctrl+T reach the shell

- Live terminals no longer reflow (xterm.dart 4.0.0 left the cursor on the
  wrong row); narrowing cuts and erases cells past the width, rows scroll
  into scrollback keeping the cursor row; finished output still reflows.
- App-side key encoding before xterm.dart's defaults: Alt as Meta (ESC +
  the typed character), Ctrl symbol table, xterm modifier parameter for
  arrows/Home/End/PgUp/PgDn/Ins/Del/F-keys, DECCKM and DECKPAM, Alt+BS.
- Settings > Appearance > Terminal: Use Option as Meta key (Macs, on).
- Inside a focused terminal only Cmd+T and Ctrl+` toggle it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 23:32:29 +00:00
parent 5ab1ec9e00
commit 7d1ffe8ad3
22 changed files with 1408 additions and 61 deletions
+11 -3
View File
@@ -90,9 +90,7 @@ class TerminalTestAppState extends State<TerminalTestApp> {
child: Scaffold(
appBar: AppBar(
title: const Text('App'),
actions: [
TerminalToggleButton(layout: widget.layout),
],
actions: [TerminalToggleButton(layout: widget.layout)],
),
body: const TextField(key: appField),
),
@@ -125,6 +123,8 @@ Future<void> chord(
}
}
/// Alt+T: shows or hides the terminal from outside it (inside, it is the
/// shell's ESC t).
Future<void> altT(WidgetTester tester, {bool settle = true}) => chord(
tester,
LogicalKeyboardKey.keyT,
@@ -132,6 +132,14 @@ Future<void> altT(WidgetTester tester, {bool settle = true}) => chord(
settle: settle,
);
/// Ctrl+`: shows or hides the terminal wherever the keyboard is.
Future<void> toggleTerminal(WidgetTester tester, {bool settle = true}) => chord(
tester,
LogicalKeyboardKey.backquote,
[LogicalKeyboardKey.controlLeft],
settle: settle,
);
Future<void> ctrlTab(WidgetTester tester, {bool reverse = false}) => chord(
tester,
LogicalKeyboardKey.tab,