Keep keys typed in a terminal out of app shortcuts

Terminals are marked as typing surfaces. While one has focus, the chat's
"/ jumps to the composer", the Search tab's Escape, Ctrl+/, Ctrl+1…9 and
Ctrl+Shift+arrow pane moves leave the key to the terminal, like they do for
text fields.
This commit is contained in:
2026-11-10 00:14:18 +00:00
parent 339cce0424
commit 750071abe1
9 changed files with 94 additions and 31 deletions
@@ -1,4 +1,5 @@
import 'package:flutter/widgets.dart';
import '../../../ui/input/keyboard_owner.dart';
/// Flutter shares a single web editing element across fields. DOM identity
/// alone cannot tell a chat composer from search, rename or another editor.
@@ -21,6 +22,7 @@ abstract final class ChatComposerPasteFocus {
return false;
}
if (_inputs.any((focus) => focus.hasFocus)) return true;
if (primaryFocusIsTypingSurface()) return true;
final context = primary.context;
if (context == null) return false;
var editable = context.widget is EditableText;