mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-04-25 19:08:39 +03:00
fix: add ( and ) to escape characters when dropping files in gtk
This commit is contained in:
@ -23,6 +23,8 @@ pub fn ShellEscapeWriter(comptime T: type) type {
|
||||
'?',
|
||||
' ',
|
||||
'|',
|
||||
'(',
|
||||
')',
|
||||
=> &[_]u8{ '\\', byte },
|
||||
else => &[_]u8{byte},
|
||||
};
|
||||
@ -93,3 +95,12 @@ test "shell escape 6" {
|
||||
try writer.writeAll("a\"c");
|
||||
try testing.expectEqualStrings("a\\\"c", fmt.getWritten());
|
||||
}
|
||||
|
||||
test "shell escape 7" {
|
||||
var buf: [128]u8 = undefined;
|
||||
var fmt = std.io.fixedBufferStream(&buf);
|
||||
var shell: ShellEscapeWriter(@TypeOf(fmt).Writer) = .{ .child_writer = fmt.writer() };
|
||||
const writer = shell.writer();
|
||||
try writer.writeAll("a(1)");
|
||||
try testing.expectEqualStrings("a\(1\)", fmt.getWritten());
|
||||
}
|
||||
|
Reference in New Issue
Block a user