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
@@ -10,6 +10,7 @@ import 'chat_mobile_panes.dart';
import 'chat_pane_switch_motion.dart';
import 'chat_pane_backdrop.dart';
import 'chat_workspace_surface.dart';
import '../../../ui/input/keyboard_owner.dart';
export 'chat_workspace_controller.dart';
export 'chat_workspace_geometry.dart' show ChatPaneDirection;
@@ -122,7 +123,8 @@ class _ChatWorkspaceState extends State<ChatWorkspace>
if (!widget.shortcutsEnabled ||
widget.controller.paneCount <= 1 ||
!_focus.hasFocus ||
event is! KeyDownEvent) {
event is! KeyDownEvent ||
primaryFocusIsTypingSurface()) {
return false;
}
final keyboard = HardwareKeyboard.instance;