From 2f187232227dde2755a7f2f2ce717f3e1f685f5c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 11:40:03 -0300 Subject: Recent keeps only files on disk, and its cap never drops an open one A renamed scratch never saved and a /virtual/ pane were recorded as recent files, and at 200 the oldest entry went even when that file was open. Opens, renames and closes now record a path only when it is a file on this host, and the cap drops the oldest closed entry. A name with a newline is not written to the kept list, where it would read back as two. Co-Authored-By: Claude Opus 5.5 --- src/exec.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/exec.zig') diff --git a/src/exec.zig b/src/exec.zig index 0e9fb6d7..fdb9bdb7 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -395,6 +395,16 @@ pub fn isDirectory(path: []const u8) bool { return stat.kind == .directory; } +/// Whether `path` is a plain file on this host, the turn out while it asks. +pub fn isFile(path: []const u8) bool { + var buf: [4096]u8 = undefined; + const z = std.fmt.bufPrintSentinel(&buf, "{s}", .{path}, 0) catch return false; + pardes.turn.yield(); + defer pardes.turn.back(); + const stat = std.Io.Dir.cwd().statFile(std.Io.Threaded.global_single_threaded.io(), z, .{}) catch return false; + return stat.kind == .file; +} + /// With `BootShell replace`, a doc landing in `col` closes a lone pristine /// shell there, the boot's placeholder, and absorbVWeight hands its space to /// the doc. With `keep`, the default, the shell stays like any other pane. -- cgit v1.3