Add split panes feature and fix alias matching

- Split Panes: Cmd+D (vertical) and Cmd+Shift+D (horizontal)
- Close panes with Cmd+W when multiple panes exist
- Fixed alias matching to work with command arguments
- Aliases now match first word only (e.g., 'gs status' works with gs=git)

Split panes allow multiple terminal sessions side-by-side in the same tab
This commit is contained in:
2026-01-31 23:27:54 +00:00
parent 7edf5d7186
commit b9570620da
4 changed files with 113 additions and 4 deletions

View File

@@ -402,11 +402,20 @@ class TerminalSession: NSObject, NSTextViewDelegate, NSMenuDelegate {
let trimmed = command.trimmingCharacters(in: .whitespacesAndNewlines)
// Check for aliases
// Check for aliases - match the first word
var actualCommand = trimmed
if let aliasCommand = TerminalSettings.shared.commandAliases[trimmed] {
actualCommand = aliasCommand
appendText("(alias: \(aliasCommand))\n")
let components = trimmed.split(separator: " ", maxSplits: 1)
if let firstWord = components.first {
let firstWordStr = String(firstWord)
if let aliasCommand = TerminalSettings.shared.commandAliases[firstWordStr] {
// Replace the alias with the actual command, keeping any arguments
if components.count > 1 {
actualCommand = aliasCommand + " " + String(components[1])
} else {
actualCommand = aliasCommand
}
appendText("(alias: \(firstWordStr) → \(aliasCommand))\n")
}
}
// Track directory changes