summaryrefslogtreecommitdiff
path: root/src/macos/Sources/AppDelegate.swift
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-21 14:55:53 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit44ce573e15c773cf5bb0d42941a143b63e44d900 (patch)
treec2c6ecd5b298a85044cb1b68e1db8f7b6657ead7 /src/macos/Sources/AppDelegate.swift
parentfd50bd971d6dea7eaaa4ee5436ba16b95fa25b30 (diff)
downloadpardes-44ce573e15c773cf5bb0d42941a143b63e44d900.tar.gz
pardes-44ce573e15c773cf5bb0d42941a143b63e44d900.zip
Make the macOS shell a first-class host
Pty children are exec'd with their own TERM/COLORTERM/TERM_PROGRAM instead of inheriting a .app launch's empty environment, and ttyTaken finally answers on darwin — libproc walks the tty's foreground process group — so Escape reaches the child and Exec stops believing every pane sits at its prompt. The occupancy suite runs on both platforms now. The workspace tag row moves into the native menu bar as a Builtins menu. -Dworkspace-tag (default off for -Dplatform=macos, on everywhere else) drives it, and Pardes.topBarHeight replaces the TOPBAR_H constant so the core stops reserving the row. The view pins every variable-font axis to the file's own default (Maple Mono came up Thin otherwise), shapes ligatures, carries per-shape pointer cursors, and draws the look-hover affordance as refracted glass. Tag rows fill edge to edge, with the anchor box painted back on top of that fill and its mode glyph centred on the same square. Theme accents re-saturated across the set. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Diffstat (limited to 'src/macos/Sources/AppDelegate.swift')
-rw-r--r--src/macos/Sources/AppDelegate.swift18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/macos/Sources/AppDelegate.swift b/src/macos/Sources/AppDelegate.swift
index cbe9cdc9..3cce7592 100644
--- a/src/macos/Sources/AppDelegate.swift
+++ b/src/macos/Sources/AppDelegate.swift
@@ -310,6 +310,16 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate {
file.addItem(withTitle: "Close Window",
action: #selector(NSWindow.performClose(_:)), keyEquivalent: "w")
+ // The workspace tag row's commands, in the place macOS keeps window
+ // commands. The build hands that row to this menu bar (see
+ // docs/macos.md): the words are the same builtins the tag carried,
+ // spelled exactly as a tag Exec would type them, and nothing here is
+ // editable — the menu is the tag's buttons, not the tag.
+ let builtins = submenu("Builtins", of: main)
+ for word in ["Newcol", "Joincol", "Find", "Grep", "Changelog",
+ "Dump", "NextColor", "Debug", "Kill"] {
+ builtins.addItem(command(word, #selector(menuBuiltin(_:)), ""))
+ }
let edit = submenu("Edit", of: main)
// Paste and nothing else. Copy, Cut, Undo and Select All have no
// builtin behind them — the core yanks into the clipboard on its own
@@ -379,13 +389,17 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate {
// here would hide half of what Look does.
panel.canChooseDirectories = true
panel.allowsMultipleSelection = true
- panel.resolvesAliases = true
- guard panel.runModal() == .OK else { return }
for url in panel.urls where url.isFileURL {
look(url.path)
}
}
+ /// Any workspace-tag word. The title is the builtin's own spelling, so
+ /// this is the same `run` a tag Exec performs and there is no second
+ /// vocabulary to keep in step.
+ @objc private func menuBuiltin(_ sender: NSMenuItem) { run(sender.title) }
+
+
@objc private func menuNew(_ sender: Any?) { run("New") }
@objc private func menuSave(_ sender: Any?) { run("Save") }
@objc private func menuHelp(_ sender: Any?) { run("Help") }