mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
cli: automatically enclose parameters in double quotes
This commit is contained in:
@ -2755,9 +2755,14 @@ pub fn parseManuallyHook(
|
|||||||
var command = std.ArrayList(u8).init(alloc);
|
var command = std.ArrayList(u8).init(alloc);
|
||||||
errdefer command.deinit();
|
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| {
|
while (iter.next()) |param| {
|
||||||
try self._replay_steps.append(alloc, .{ .arg = try alloc.dupe(u8, param) });
|
try self._replay_steps.append(alloc, .{ .arg = try alloc.dupe(u8, param) });
|
||||||
|
try command.append('"');
|
||||||
try command.appendSlice(param);
|
try command.appendSlice(param);
|
||||||
|
try command.append('"');
|
||||||
try command.append(' ');
|
try command.append(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user