summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 07d5e92f..e2b9f880 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -488,7 +488,8 @@ pub fn commandText(txt: []const u8) []const u8 {
pub fn executeBuiltinLine(p: *Pardes, id: usize, txt: []const u8) bool {
const cmd = commandText(txt);
if (cmd.len == 0 or p.exec_depth >= max_exec_depth) return false;
- const sp = std.mem.indexOfAny(u8, cmd, " \t");
+ // `Word arg`, or as one word a tag can hold, `Word+arg` (`Tty+fish`).
+ const sp = std.mem.indexOfAny(u8, cmd, " \t") orelse std.mem.indexOfScalar(u8, cmd, '+');
const bi: ?Builtin = std.meta.stringToEnum(Builtin, cmd) orelse blk: {
const head = std.meta.stringToEnum(Builtin, cmd[0 .. sp orelse break :blk null]) orelse break :blk null;
break :blk if (builtins.registry.takesArg(head)) head else null;