From 1ba45200ee42122ebd2c3bbe356a21c9a0df061b Mon Sep 17 00:00:00 2001 From: MacRimi Date: Mon, 24 Nov 2025 11:01:48 +0100 Subject: [PATCH] Update AppImage --- AppImage/components/terminal-panel.tsx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/AppImage/components/terminal-panel.tsx b/AppImage/components/terminal-panel.tsx index fe025bf..6aca278 100644 --- a/AppImage/components/terminal-panel.tsx +++ b/AppImage/components/terminal-panel.tsx @@ -171,6 +171,10 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl resizeStartY.current = e.clientY resizeStartHeight.current = terminalHeight e.preventDefault() + e.stopPropagation() + // Deshabilitar selección de texto durante el resize + document.body.style.userSelect = "none" + document.body.style.cursor = "ns-resize" }, [isMobile, terminalHeight], ) @@ -179,6 +183,9 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl (e: MouseEvent) => { if (!isResizing) return + e.preventDefault() + e.stopPropagation() + const deltaY = e.clientY - resizeStartY.current const newHeight = Math.max(200, Math.min(1200, resizeStartHeight.current + deltaY)) setTerminalHeight(newHeight) @@ -190,15 +197,19 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl if (!isResizing) return setIsResizing(false) localStorage.setItem("terminalHeight", terminalHeight.toString()) + // Restaurar selección de texto y cursor + document.body.style.userSelect = "" + document.body.style.cursor = "" }, [isResizing, terminalHeight]) useEffect(() => { if (isResizing) { - document.addEventListener("mousemove", handleMouseMove) - document.addEventListener("mouseup", handleResizeEnd) + // Agregar capture: true para mejor compatibilidad + document.addEventListener("mousemove", handleMouseMove, { capture: true }) + document.addEventListener("mouseup", handleResizeEnd, { capture: true }) return () => { - document.removeEventListener("mousemove", handleMouseMove) - document.removeEventListener("mouseup", handleResizeEnd) + document.removeEventListener("mousemove", handleMouseMove, { capture: true }) + document.removeEventListener("mouseup", handleResizeEnd, { capture: true }) } } }, [isResizing, handleMouseMove, handleResizeEnd]) @@ -359,10 +370,12 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl import("xterm/css/xterm.css"), ]).then(([Terminal, FitAddon]) => [Terminal, FitAddon]) + const fontSize = window.innerWidth < 768 ? 12 : 16 + const term = new TerminalClass({ rendererType: "dom", fontFamily: '"Courier", "Courier New", "Liberation Mono", "DejaVu Sans Mono", monospace', - fontSize: isMobile ? 12 : 16, + fontSize: fontSize, lineHeight: 1, cursorBlink: true, scrollback: 2000,