refactor: replace ghostty wrapper with proper CLI actions for terminfo cache management

- Add +list-ssh-cache and +clear-ssh-cache CLI actions
- Remove ghostty() wrapper functions from all shell integrations
- Improve variable naming in shell scripts for readability

Addresses @00-kat's feedback about CLI discoverability and naming
consistency. The new CLI actions follow established Ghostty patterns
and are discoverable via `ghostty --help`, while maintaining clean
separation of concerns between shell logic and cache management.
This commit is contained in:
Jason Rayne
2025-06-25 12:47:38 -07:00
parent 6789b7fb6e
commit 0565ed3954
8 changed files with 299 additions and 173 deletions

View File

@@ -9,6 +9,8 @@ const list_keybinds = @import("list_keybinds.zig");
const list_themes = @import("list_themes.zig");
const list_colors = @import("list_colors.zig");
const list_actions = @import("list_actions.zig");
const list_ssh_cache = @import("list_ssh_cache.zig");
const clear_ssh_cache = @import("clear_ssh_cache.zig");
const edit_config = @import("edit_config.zig");
const show_config = @import("show_config.zig");
const validate_config = @import("validate_config.zig");
@@ -41,6 +43,12 @@ pub const Action = enum {
/// List keybind actions
@"list-actions",
/// List hosts with Ghostty SSH terminfo installed
@"list-ssh-cache",
/// Clear Ghostty SSH terminfo cache
@"clear-ssh-cache",
/// Edit the config file in the configured terminal editor.
@"edit-config",
@@ -155,6 +163,8 @@ pub const Action = enum {
.@"list-themes" => try list_themes.run(alloc),
.@"list-colors" => try list_colors.run(alloc),
.@"list-actions" => try list_actions.run(alloc),
.@"list-ssh-cache" => @import("list_ssh_cache.zig").run(alloc),
.@"clear-ssh-cache" => @import("clear_ssh_cache.zig").run(alloc),
.@"edit-config" => try edit_config.run(alloc),
.@"show-config" => try show_config.run(alloc),
.@"validate-config" => try validate_config.run(alloc),
@@ -192,6 +202,8 @@ pub const Action = enum {
.@"list-themes" => list_themes.Options,
.@"list-colors" => list_colors.Options,
.@"list-actions" => list_actions.Options,
.@"list-ssh-cache" => list_ssh_cache.Options,
.@"clear-ssh-cache" => clear_ssh_cache.Options,
.@"edit-config" => edit_config.Options,
.@"show-config" => show_config.Options,
.@"validate-config" => validate_config.Options,