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() {
|
@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.textView.string = ""
|
||||||
session.showPrompt()
|
session.showPrompt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func clearScrollback() {
|
@objc func clearScrollback() {
|
||||||
if let session = tabManager.getCurrentSession() {
|
// Get the active session (either from pane or tab)
|
||||||
let alert = NSAlert()
|
let session: TerminalSession?
|
||||||
alert.messageText = "Clear Scrollback?"
|
if panes.count > 0 && activePaneIndex < panes.count {
|
||||||
alert.informativeText = "This will clear all terminal output history."
|
session = panes[activePaneIndex]
|
||||||
alert.addButton(withTitle: "Clear")
|
} else {
|
||||||
alert.addButton(withTitle: "Cancel")
|
session = tabManager.getCurrentSession()
|
||||||
alert.alertStyle = .warning
|
}
|
||||||
|
|
||||||
if alert.runModal() == .alertFirstButtonReturn {
|
guard let activeSession = session else { return }
|
||||||
session.textView.string = ""
|
|
||||||
session.showPrompt()
|
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("Features:\n")
|
||||||
appendText(" • Cmd+T: New tab\n")
|
appendText(" • Cmd+T: New tab\n")
|
||||||
appendText(" • Cmd+R: Search history (fuzzy search)\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+P: Command snippets\n")
|
||||||
|
appendText(" • Cmd+K: Clear screen\n")
|
||||||
appendText(" • Tab: Accept auto-suggestion\n")
|
appendText(" • Tab: Accept auto-suggestion\n")
|
||||||
appendText(" • Type 'help' for more commands\n")
|
appendText(" • Type 'help' for more commands\n")
|
||||||
appendText("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n")
|
appendText("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user