diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index 7d3e377d..8e55f02b 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -257,7 +257,18 @@ export class BaseTerminalTabComponent

extends Bas this.frontend?.selectAll() break case 'clear': - this.forEachFocusedTerminalPane(tab => tab.frontend?.clear()) + this.forEachFocusedTerminalPane(tab => { + const tabProfile = tab.profile + const shellType: string = tabProfile.options?.shellType ?? '' + const shellArgs: string[] = tabProfile.options?.args ?? [] + if (this.hostApp.platform === Platform.Windows && (shellType === 'powershell' || shellArgs.some(arg => arg.includes('clink')))) { + // Windows PowerShell and cmd(Clink): send Ctrl+L to PTY (natively clears) + tab.sendInput('\x0c') + } else { + // Windows cmd(stock) and macOS/Linux: clear xterm buffer only + tab.frontend?.clear() + } + }) break case 'zoom-in': this.forEachFocusedTerminalPane(tab => tab.zoomIn())