diff options
Diffstat (limited to 'core/exec.zig')
| -rw-r--r-- | core/exec.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/exec.zig b/core/exec.zig index 3f3b16a7..0e09e175 100644 --- a/core/exec.zig +++ b/core/exec.zig @@ -423,19 +423,19 @@ pub fn missingDir(p: *Pardes, dir: []const u8) bool { // the shell would start: no command or terminal runs there, and none // is made to say `exit 127`. const local = @import("fs.zig").localPath(dir) orelse return std.mem.startsWith(u8, dir, "/n/"); - return kindOf(local) != .directory; + return kindOf(p.tape, local) != .directory; } /// What `path` is on this host, null when it is not there; the turn out /// while it asks (it may be inside a mount this editor serves). -pub fn kindOf(path: []const u8) ?std.Io.File.Kind { +pub fn kindOf(tape: *pardes.tape.Tape, path: []const u8) ?std.Io.File.Kind { var buf: [4096]u8 = undefined; const z = std.fmt.bufPrintSentinel(&buf, "{s}", .{path}, 0) catch return null; - return pardes.tape.site(.kind, null, kindHost, .{z}); + return tape.site(.kind, null, kindHost, .{z}); } -fn kindHost(z: [:0]const u8) ?std.Io.File.Kind { - const stat = @import("fs.zig").statPath(std.Io.Threaded.global_single_threaded.io(), z, .{}) catch return null; +fn kindHost(io: std.Io, z: [:0]const u8) ?std.Io.File.Kind { + const stat = @import("fs.zig").statPath(io, z, .{}) catch return null; return stat.kind; } @@ -1039,18 +1039,18 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] var text: pardes.Kind.Buf(340) = .{}; return p.reportFailure(v.active, text.print("Shell: {s}", .{refused})); } - if (!p.settings.apply(setting, want, p.sessionHome())) p.reportFailure(v.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?); + if (!p.settings.apply(p.tape, setting, want, p.sessionHome())) p.reportFailure(v.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?); }, // Bare, each says its value, as acme's Tab says the width. inline .tab, .callstack_depth => |_, tag| if (arg == null) { var said: pardes.Kind.Buf(40) = .{}; return p.setMessage(v.active, said.print("{s} {d}", .{ setting.word, @field(p.settings, @tagName(tag)) })); - } else if (!p.settings.apply(setting, arg, p.sessionHome())) { + } else if (!p.settings.apply(p.tape, setting, arg, p.sessionHome())) { var said: pardes.Kind.Buf(96) = .{}; p.reportFailure(v.active, said.print("{s}{s}: takes {s}", .{ setting.word, if (tag == .tab) ": invalid tab width" else "", comptime config.Runtime.takes(tag).? })); }, // Said with what it takes: its words, its range. - else => if (!p.settings.apply(setting, arg, p.sessionHome())) { + else => if (!p.settings.apply(p.tape, setting, arg, p.sessionHome())) { var buf: [160]u8 = undefined; var text: std.Io.Writer = .fixed(&buf); // A list of values too long for the row is cut. |
