fixes #10039 - ignore focus escape sequences when auto-scrolling to the bottom (#10555)

This commit is contained in:
SilverFox 2025-06-27 16:27:09 +08:00 committed by GitHub
parent 93e43067de
commit 0cf9886270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,8 @@ import { getTerminalBackgroundColor } from '../helpers'
const INACTIVE_TAB_UNLOAD_DELAY = 1000 * 30 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 * A class to base your custom terminal tabs on
@ -494,7 +496,7 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
data = Buffer.from(data, 'utf-8') data = Buffer.from(data, 'utf-8')
} }
this.session?.feedFromTerminal(data) 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() this.frontend?.scrollToBottom()
} }
} }