aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/cli/ghostty.zig
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 21:51:57 +0300
committerGitHub <noreply@github.com>2026-09-10 21:51:57 +0300
commit425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch)
treee52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/cli/ghostty.zig
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/cli/ghostty.zig')
-rw-r--r--vendor/libghostty-vt/src/cli/ghostty.zig30
1 files changed, 20 insertions, 10 deletions
diff --git a/vendor/libghostty-vt/src/cli/ghostty.zig b/vendor/libghostty-vt/src/cli/ghostty.zig
index 6e836851..572aa8ad 100644
--- a/vendor/libghostty-vt/src/cli/ghostty.zig
+++ b/vendor/libghostty-vt/src/cli/ghostty.zig
@@ -21,7 +21,9 @@ const crash_report = @import("crash_report.zig");
const show_face = @import("show_face.zig");
const boo = @import("boo.zig");
const new_window = @import("new_window.zig");
+const new_tab = @import("new_tab.zig");
const toggle_quick_terminal = @import("toggle_quick_terminal.zig");
+const global = @import("../global.zig");
/// Special commands that can be invoked via CLI flags. These are all
/// invoked by using `+<action>` as a CLI flag. The only exception is
@@ -78,6 +80,9 @@ pub const Action = enum {
// Use IPC to tell the running Ghostty to open a new window.
@"new-window",
+ // Use IPC to tell the running Ghostty to open a new tab.
+ @"new-tab",
+
// Use IPC to tell the running Ghostty to toggle the quick terminal.
@"toggle-quick-terminal",
@@ -120,7 +125,10 @@ pub const Action = enum {
if (std.mem.eql(u8, field.name, @tagName(self))) {
var buffer: [1024]u8 = undefined;
- var stdout_writer = std.fs.File.stdout().writer(&buffer);
+ var stdout_writer = std.Io.File.stdout().writer(
+ global.io(),
+ &buffer,
+ );
const stdout = &stdout_writer.interface;
const text = @field(help_strings.Action, field.name) ++ "\n";
stdout.writeAll(text) catch |write_err| {
@@ -161,6 +169,7 @@ pub const Action = enum {
.@"show-face" => try show_face.run(alloc),
.boo => try boo.run(alloc),
.@"new-window" => try new_window.run(alloc),
+ .@"new-tab" => try new_tab.run(alloc),
.@"toggle-quick-terminal" => try toggle_quick_terminal.run(alloc),
};
}
@@ -203,6 +212,7 @@ pub const Action = enum {
.@"show-face" => show_face.Options,
.boo => boo.Options,
.@"new-window" => new_window.Options,
+ .@"new-tab" => new_tab.Options,
.@"toggle-quick-terminal" => toggle_quick_terminal.Options,
};
}
@@ -213,7 +223,7 @@ test "parse action none" {
const testing = std.testing;
const alloc = testing.allocator;
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"--a=42 --b --b-f=false",
);
@@ -227,7 +237,7 @@ test "parse action version" {
const alloc = testing.allocator;
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"--a=42 --b --b-f=false --version",
);
@@ -237,7 +247,7 @@ test "parse action version" {
}
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"--version --a=42 --b --b-f=false",
);
@@ -247,7 +257,7 @@ test "parse action version" {
}
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"--c=84 --d --version --a=42 --b --b-f=false",
);
@@ -262,7 +272,7 @@ test "parse action plus" {
const alloc = testing.allocator;
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"--a=42 --b --b-f=false +version",
);
@@ -272,7 +282,7 @@ test "parse action plus" {
}
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"+version --a=42 --b --b-f=false",
);
@@ -282,7 +292,7 @@ test "parse action plus" {
}
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"--c=84 --d +version --a=42 --b --b-f=false",
);
@@ -297,7 +307,7 @@ test "parse action plus ignores -e" {
const alloc = testing.allocator;
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"--a=42 -e +version",
);
@@ -307,7 +317,7 @@ test "parse action plus ignores -e" {
}
{
- var iter = try std.process.ArgIteratorGeneral(.{}).init(
+ var iter = try std.process.Args.IteratorGeneral(.{}).init(
alloc,
"+list-fonts --a=42 -e +version",
);