Fix clearScreen/clearScrollback for split panes and update all help text

- Fixed Cmd+K crash by handling both tab and split pane modes
- Updated startup message to show Cmd+I for AI (not Cmd+K)
- clearScreen and clearScrollback now work with active pane
- All documentation now consistent with correct shortcuts
This commit is contained in:
2026-02-01 00:00:32 +00:00
parent 1a8f23fcb1
commit 09f90a736a
5 changed files with 29 additions and 14 deletions

View File

@@ -533,25 +533,39 @@ class MainWindowController: NSWindowController {
}
@objc func clearScreen() {
if let session = tabManager.getCurrentSession() {
// If in split pane mode, clear the active pane
if panes.count > 0 && activePaneIndex < panes.count {
let session = panes[activePaneIndex]
session.textView.string = ""
session.showPrompt()
} else if let session = tabManager.getCurrentSession() {
// Otherwise clear the current tab
session.textView.string = ""
session.showPrompt()
}
}
@objc func clearScrollback() {
if let session = tabManager.getCurrentSession() {
let alert = NSAlert()
alert.messageText = "Clear Scrollback?"
alert.informativeText = "This will clear all terminal output history."
alert.addButton(withTitle: "Clear")
alert.addButton(withTitle: "Cancel")
alert.alertStyle = .warning
if alert.runModal() == .alertFirstButtonReturn {
session.textView.string = ""
session.showPrompt()
}
// Get the active session (either from pane or tab)
let session: TerminalSession?
if panes.count > 0 && activePaneIndex < panes.count {
session = panes[activePaneIndex]
} else {
session = tabManager.getCurrentSession()
}
guard let activeSession = session else { return }
let alert = NSAlert()
alert.messageText = "Clear Scrollback?"
alert.informativeText = "This will clear all terminal output history."
alert.addButton(withTitle: "Clear")
alert.addButton(withTitle: "Cancel")
alert.alertStyle = .warning
if alert.runModal() == .alertFirstButtonReturn {
activeSession.textView.string = ""
activeSession.showPrompt()
}
}