summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index e55a418f..9208b9f8 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -436,6 +436,20 @@ pub const Filter = struct {
}
};
+/// Switch this terminal between raw program input and normal editor mode.
+pub const Togglettymode = struct {
+ pub fn run(c: Ctx) void {
+ c.p.toggleTty(c.id);
+ }
+};
+
+/// Fold a pane to its tag, or restore its share of the column.
+pub const Collapse = struct {
+ pub fn run(c: Ctx) void {
+ layout.toggleCollapse(c.p, c.id);
+ }
+};
+
pub const Delcol = struct {
pub fn run(c: Ctx) void {
c.p.removeColumn(c.id) catch |err| c.p.reportError(c.id, "close column", err);
@@ -444,7 +458,7 @@ pub const Delcol = struct {
/// A shell in the calling pane's directory, raw from the first frame. On every
/// pane's tagline: the fast path from wherever you are to a prompt there.
-pub const Newtty = struct {
+pub const Tty = struct {
pub fn run(c: Ctx) void {
c.p.spawnTty(c.id);
}
@@ -509,6 +523,16 @@ pub const EffectCode = struct {
}
};
+/// An optional SDL workspace-tag companion; never consumes input or text cells.
+pub const Pet = struct {
+ pub const takes_arg = true;
+ pub const enabled = pardes.platform == .gui;
+ pub fn run(c: Ctx) void {
+ const name = std.mem.trim(u8, c.arg orelse return, " \t\r\n");
+ c.p.settings.pet = std.meta.stringToEnum(@TypeOf(c.p.settings.pet), name) orelse return;
+ }
+};
+
pub const Mini = struct {
pub const takes_arg = true;
pub const output: OutputTraits = .{ .name = "Mini", .doc = true };