Add 5 new features: edit snippets, clear scrollback, category filter, find in terminal, startup commands
1. Edit Snippets: Edit button to modify existing snippets 2. Clear Scrollback: Cmd+Shift+K to clear all terminal output 3. Category Filter: Dropdown to filter snippets by category 4. Find in Terminal: Cmd+F to search terminal output (built-in) 5. Startup Commands: Configure commands to run when opening new tabs All features tested and working
This commit is contained in:
@@ -141,6 +141,7 @@ class MainWindowController: NSWindowController {
|
||||
fileMenu.addItem(NSMenuItem(title: "Close Tab", action: #selector(closeCurrentTab), keyEquivalent: "w"))
|
||||
fileMenu.addItem(NSMenuItem.separator())
|
||||
fileMenu.addItem(NSMenuItem(title: "Clear Screen", action: #selector(clearScreen), keyEquivalent: "k"))
|
||||
fileMenu.addItem(NSMenuItem(title: "Clear Scrollback", action: #selector(clearScrollback), keyEquivalent: "K"))
|
||||
|
||||
// Edit menu
|
||||
let editMenuItem = NSMenuItem(title: "Edit", action: nil, keyEquivalent: "")
|
||||
@@ -152,6 +153,8 @@ class MainWindowController: NSWindowController {
|
||||
editMenu.addItem(NSMenuItem(title: "Paste", action: #selector(NSText.paste(_:)), keyEquivalent: "v"))
|
||||
editMenu.addItem(NSMenuItem(title: "Select All", action: #selector(NSText.selectAll(_:)), keyEquivalent: "a"))
|
||||
editMenu.addItem(NSMenuItem.separator())
|
||||
editMenu.addItem(NSMenuItem(title: "Find...", action: #selector(showFindPanel), keyEquivalent: "f"))
|
||||
editMenu.addItem(NSMenuItem.separator())
|
||||
|
||||
let searchHistoryItem = NSMenuItem(title: "Search History", action: #selector(searchHistory), keyEquivalent: "r")
|
||||
searchHistoryItem.keyEquivalentModifierMask = [.command]
|
||||
@@ -453,6 +456,28 @@ class MainWindowController: NSWindowController {
|
||||
}
|
||||
}
|
||||
|
||||
@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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc func showFindPanel() {
|
||||
if let session = tabManager.getCurrentSession() {
|
||||
session.textView.performTextFinderAction(nil)
|
||||
}
|
||||
}
|
||||
|
||||
@objc func clearHistory() {
|
||||
let alert = NSAlert()
|
||||
alert.messageText = "Clear Command History?"
|
||||
|
||||
Reference in New Issue
Block a user