fix: forward browser terminal pastes as bracketed input

- Track application bracketed-paste mode from terminal output.
- Capture browser and mobile clipboard pastes only while that mode is enabled,
  normalizing line endings and sending a single BPM-framed input event.
- Remove the synchronous output decoding and console diagnostics that could
  stall terminal rendering under output load.
- Keep the terminal's zero-scrollback configuration and resolve existing
  no-case-declarations lint blockers in terminal keyboard shortcuts.

Quality gates: npm run typecheck, npm run lint
This commit is contained in:
Developer
2026-07-14 10:02:30 +00:00
parent d1777b88ad
commit 41d24beade
2 changed files with 91 additions and 28 deletions
+10 -7
View File
@@ -169,6 +169,10 @@ export const useTerminalPage = () => {
const isAltShift = e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey;
if (!isAltShift) return;
const activeSessionIndex = activeSessionId
? sessions.findIndex((session) => session.id === activeSessionId)
: -1;
switch (e.key.toLowerCase()) {
case "n":
e.preventDefault();
@@ -187,17 +191,14 @@ export const useTerminalPage = () => {
break;
case "arrowleft":
e.preventDefault();
if (activeSessionId) {
const idx = sessions.findIndex((s) => s.id === activeSessionId);
if (idx > 0) setActiveSessionId(sessions[idx - 1].id);
if (activeSessionIndex > 0) {
setActiveSessionId(sessions[activeSessionIndex - 1].id);
}
break;
case "arrowright":
e.preventDefault();
if (activeSessionId) {
const idx = sessions.findIndex((s) => s.id === activeSessionId);
if (idx < sessions.length - 1)
setActiveSessionId(sessions[idx + 1].id);
if (activeSessionIndex >= 0 && activeSessionIndex < sessions.length - 1) {
setActiveSessionId(sessions[activeSessionIndex + 1].id);
}
break;
case "r":
@@ -208,6 +209,8 @@ export const useTerminalPage = () => {
e.preventDefault();
setIsFullscreen((prev) => !prev);
break;
default:
break;
}
};