From 8919957d4ae6f31bdeda89855bbaa9e69a3e9521 Mon Sep 17 00:00:00 2001 From: archipelago Date: Fri, 9 Oct 2026 11:03:28 -0400 Subject: [PATCH] fix: align terminal focus and default window with app chrome --- neode-ui/src/components/CLIPopup.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/neode-ui/src/components/CLIPopup.vue b/neode-ui/src/components/CLIPopup.vue index 8d69fb20..91f3924e 100644 --- a/neode-ui/src/components/CLIPopup.vue +++ b/neode-ui/src/components/CLIPopup.vue @@ -3,7 +3,7 @@
-
+
@@ -108,7 +108,7 @@ function connectSelected() { disconnect(); terminal?.reset() if (!selectedId.value) return socket = new WebSocket(wsUrl(selectedId.value)) - socket.onopen = () => { connected.value = true; resizeTerminal(); focusInput() } + socket.onopen = () => { connected.value = true; resizeTerminal() } socket.onclose = () => { connected.value = false } socket.onerror = () => { connected.value = false } socket.onmessage = event => { @@ -139,6 +139,7 @@ onMounted(() => { terminal = new Terminal({ convertEol: true, cursorBlink: true, + cursorInactiveStyle: 'none', fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace', fontSize: 13, lineHeight: 1.45, @@ -155,9 +156,14 @@ onMounted(() => { } nextTick(resizeTerminal) }) +function blurTerminalWhenOutside(event: PointerEvent) { + if (panelRef.value && !panelRef.value.contains(event.target as Node)) terminal?.blur() +} +onMounted(() => window.addEventListener('pointerdown', blurTerminalWhenOutside, true)) onBeforeUnmount(() => { window.removeEventListener('mousemove', onDrag) window.removeEventListener('mouseup', stopDrag) + window.removeEventListener('pointerdown', blurTerminalWhenOutside, true) resizeObserver?.disconnect() terminal?.dispose() disconnect() @@ -165,11 +171,11 @@ onBeforeUnmount(() => {