fix: ESC key, .config, workspace permissions, terminal race condition

This commit is contained in:
2026-06-01 23:16:06 +02:00
parent a0cfbbc2d2
commit 8837031fd2
4 changed files with 61 additions and 60 deletions
+2 -17
View File
@@ -314,17 +314,6 @@ export const TerminalComponent = React.forwardRef<TerminalRef, TerminalProps>(
// Open xterm first (must happen before fit)
term.open(container);
term.focus();
// Allow ESC to propagate to browser when not in alternate buffer (vim/tmux)
term.attachCustomKeyEventHandler((e) => {
if (e.key === "Escape") {
const isAlternate =
term.buffer.active.type === "alternate";
return isAlternate; // true = xterm handles it, false = browser handles it
}
return true;
});
const ws = connectWebSocket();
// Mobile touch scroll.
@@ -366,16 +355,12 @@ export const TerminalComponent = React.forwardRef<TerminalRef, TerminalProps>(
// If the viewport is scrollable, scroll it directly.
// Otherwise we are in alternate screen (tmux/vim) and must
// send SGR 1006 mouse-wheel protocol data.
const hasScrollback =
viewport.scrollHeight > viewport.clientHeight;
const hasScrollback = viewport.scrollHeight > viewport.clientHeight;
if (hasScrollback) {
viewport.scrollTop += deltaY;
} else {
const ws = wsRef.current;
if (
ws?.readyState === WebSocket.OPEN &&
termRef.current
) {
if (ws?.readyState === WebSocket.OPEN && termRef.current) {
// Use the cursor position as the wheel location so
// tmux knows which pane to scroll.
const buf = termRef.current.buffer.active;