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:
Binary file not shown.
Binary file not shown.
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -200,8 +200,9 @@ class TerminalSession: NSObject, NSTextViewDelegate, NSMenuDelegate {
|
||||
appendText("Features:\n")
|
||||
appendText(" • Cmd+T: New tab\n")
|
||||
appendText(" • Cmd+R: Search history (fuzzy search)\n")
|
||||
appendText(" • Cmd+K: AI command generator\n")
|
||||
appendText(" • Cmd+I: AI command generator\n")
|
||||
appendText(" • Cmd+P: Command snippets\n")
|
||||
appendText(" • Cmd+K: Clear screen\n")
|
||||
appendText(" • Tab: Accept auto-suggestion\n")
|
||||
appendText(" • Type 'help' for more commands\n")
|
||||
appendText("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n")
|
||||
|
||||
Reference in New Issue
Block a user