From 0cf9886270d7b616f5cd9beb29203e62700212b0 Mon Sep 17 00:00:00 2001 From: SilverFox Date: Fri, 27 Jun 2025 16:27:09 +0800 Subject: [PATCH] fixes #10039 - ignore focus escape sequences when auto-scrolling to the bottom (#10555) --- tabby-terminal/src/api/baseTerminalTab.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index e26ca640..f281f3cb 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -17,6 +17,8 @@ import { getTerminalBackgroundColor } from '../helpers' const INACTIVE_TAB_UNLOAD_DELAY = 1000 * 30 +const OSC_FOCUS_IN = Buffer.from('\x1b[I') +const OSC_FOCUS_OUT = Buffer.from('\x1b[O') /** * A class to base your custom terminal tabs on @@ -494,7 +496,7 @@ export class BaseTerminalTabComponent

extends Bas data = Buffer.from(data, 'utf-8') } this.session?.feedFromTerminal(data) - if (this.config.store.terminal.scrollOnInput) { + if (this.config.store.terminal.scrollOnInput && !data.equals(OSC_FOCUS_IN) && !data.equals(OSC_FOCUS_OUT)) { this.frontend?.scrollToBottom() } }