summaryrefslogtreecommitdiff
path: root/src/tty
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-02 18:35:29 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit45f152b2de946aa7c7ed5ffe37d07b0930dfc38b (patch)
tree0b18f8484163596414b20ee75a13fb508babc4ec /src/tty
parent35cecf26b06cf50d9827056da99d883ca975c39b (diff)
downloadpardes-45f152b2de946aa7c7ed5ffe37d07b0930dfc38b.tar.gz
pardes-45f152b2de946aa7c7ed5ffe37d07b0930dfc38b.zip
add New builtin for an empty temporary file in the calling column
Diffstat (limited to 'src/tty')
-rw-r--r--src/tty/tty.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig
index 60a2d958..6f7cc5ba 100644
--- a/src/tty/tty.zig
+++ b/src/tty/tty.zig
@@ -11,6 +11,7 @@ const vaxis = @import("vaxis");
const pardes = @import("../pardes.zig");
const tracy = @import("../tracy.zig");
const look = @import("../look.zig");
+const temp_file = @import("../temp_file.zig");
extern "c" fn forkpty(amaster: *c_int, name: ?[*:0]u8, termp: ?*const anyopaque, winp: ?*const posix.winsize) c_int;
extern "c" fn execv(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int;
@@ -684,6 +685,14 @@ fn drainEffects(
// from the bytes we just put there so it reads as "no change"
if (watches[sf.pane]) |*w| w.hash = std.hash.Wyhash.hash(0, f.content);
},
+ .new_file => |request| {
+ var path_buf: [4096:0]u8 = undefined;
+ const made = temp_file.create(&path_buf) orelse continue;
+ if (core.openNewFile(request.pane, request.serial, made.path))
+ made.adopt()
+ else
+ made.discard();
+ },
.write_dump => {
const out = core.dump_out orelse continue;
var pbuf: [1024:0]u8 = undefined;