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:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user