From ea0d6be1db6e69dd70bd0c407d5d7c84d7682ecd Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Fri, 8 Nov 2024 15:18:31 +0800 Subject: [PATCH] cli: automatically enclose parameters in double quotes --- src/config/Config.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config/Config.zig b/src/config/Config.zig index 48de522f7..29da5ee15 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -2755,9 +2755,14 @@ pub fn parseManuallyHook( var command = std.ArrayList(u8).init(alloc); errdefer command.deinit(); + // Parameters following `-e` must be enclosed in double quotes + // to prevent arguments with spaces from being treated + // as two separate parameters. while (iter.next()) |param| { try self._replay_steps.append(alloc, .{ .arg = try alloc.dupe(u8, param) }); + try command.append('"'); try command.appendSlice(param); + try command.append('"'); try command.append(' '); }