mirror of
https://github.com/eugeny/tabby
synced 2026-09-23 05:25:58 +00:00
fix(terminal): fix Clear terminal hotkey action in PowerShell and Clink (#11405)
Co-authored-by: Eugene <inbox@null.page>
This commit is contained in:
@@ -257,7 +257,18 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> 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())
|
||||
|
||||
Reference in New Issue
Block a user