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:
@@ -13,6 +13,7 @@ import 'list_pane_widths.dart';
|
||||
import 'shell_bar.dart';
|
||||
import 'shell_list_shortcuts.dart';
|
||||
import 'tab_history.dart';
|
||||
import '../ui/input/keyboard_owner.dart';
|
||||
|
||||
class AdaptiveShell extends StatefulWidget {
|
||||
const AdaptiveShell({
|
||||
@@ -297,6 +298,8 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
/// fields. Split-pane navigation belongs to the chat workspace; tab changes
|
||||
/// have no global keyboard chord.
|
||||
bool _handleDestinationKeyEvent(KeyEvent event) {
|
||||
// A terminal keeps its keys (Escape, Ctrl+/, Ctrl+digits).
|
||||
if (primaryFocusIsTypingSurface()) return false;
|
||||
final keyboard = HardwareKeyboard.instance;
|
||||
if (_selected == AppDestination.search &&
|
||||
event is KeyDownEvent &&
|
||||
|
||||
Reference in New Issue
Block a user