mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-05 15:33:00 +00:00
terminal(dcs): convert all xtgettcap queries to upper (#7230)
Some checks are pending
Nix / Required Checks: Nix (push) Blocked by required conditions
Nix / check-zig-cache-hash (push) Waiting to run
Test / build-macos (push) Blocked by required conditions
Test / build-macos-matrix (push) Blocked by required conditions
Test / build-snap (namespace-profile-ghostty-snap) (push) Blocked by required conditions
Test / Build -Dsentry=true (push) Blocked by required conditions
Test / test-macos (push) Blocked by required conditions
Test / zig-fmt (push) Waiting to run
Test / prettier (push) Waiting to run
Test / alejandra (push) Waiting to run
Test / typos (push) Waiting to run
Test / translations (push) Waiting to run
Test / blueprint-compiler (push) Waiting to run
Test / Test pkg/wuffs (push) Blocked by required conditions
Test / Test build on Debian 12 (push) Blocked by required conditions
Test / flatpak-check-zig-cache (push) Waiting to run
Test / Flatpak (map[arch:aarch64 runner:namespace-profile-ghostty-md-arm64]) (push) Blocked by required conditions
Test / Flatpak (map[arch:x86_64 runner:namespace-profile-ghostty-md]) (push) Blocked by required conditions
Test / build-dist (push) Blocked by required conditions
Test / Required Checks: Test (push) Blocked by required conditions
Test / build-bench (push) Blocked by required conditions
Test / build-flatpak (push) Blocked by required conditions
Test / build-linux (namespace-profile-ghostty-md) (push) Blocked by required conditions
Test / build-linux (namespace-profile-ghostty-md-arm64) (push) Blocked by required conditions
Test / build-linux-libghostty (push) Blocked by required conditions
Test / build-nix (namespace-profile-ghostty-md) (push) Blocked by required conditions
Test / build-nix (namespace-profile-ghostty-md-arm64) (push) Blocked by required conditions
Test / build-snap (namespace-profile-ghostty-snap-arm64) (push) Blocked by required conditions
Test / build-windows (push) Blocked by required conditions
Test / build-windows-cross (namespace-profile-ghostty-md, x86-windows-gnu) (push) Blocked by required conditions
Test / build-windows-cross (namespace-profile-ghostty-md, x86_64-windows-gnu) (push) Blocked by required conditions
Test / test (push) Waiting to run
Test / GTK x11=false wayland=false (push) Blocked by required conditions
Test / GTK x11=true wayland=false (push) Blocked by required conditions
Test / GTK x11=false wayland=true (push) Blocked by required conditions
Test / GTK x11=true wayland=true (push) Blocked by required conditions
Test / Build -Dsentry=false (push) Blocked by required conditions
Some checks are pending
Nix / Required Checks: Nix (push) Blocked by required conditions
Nix / check-zig-cache-hash (push) Waiting to run
Test / build-macos (push) Blocked by required conditions
Test / build-macos-matrix (push) Blocked by required conditions
Test / build-snap (namespace-profile-ghostty-snap) (push) Blocked by required conditions
Test / Build -Dsentry=true (push) Blocked by required conditions
Test / test-macos (push) Blocked by required conditions
Test / zig-fmt (push) Waiting to run
Test / prettier (push) Waiting to run
Test / alejandra (push) Waiting to run
Test / typos (push) Waiting to run
Test / translations (push) Waiting to run
Test / blueprint-compiler (push) Waiting to run
Test / Test pkg/wuffs (push) Blocked by required conditions
Test / Test build on Debian 12 (push) Blocked by required conditions
Test / flatpak-check-zig-cache (push) Waiting to run
Test / Flatpak (map[arch:aarch64 runner:namespace-profile-ghostty-md-arm64]) (push) Blocked by required conditions
Test / Flatpak (map[arch:x86_64 runner:namespace-profile-ghostty-md]) (push) Blocked by required conditions
Test / build-dist (push) Blocked by required conditions
Test / Required Checks: Test (push) Blocked by required conditions
Test / build-bench (push) Blocked by required conditions
Test / build-flatpak (push) Blocked by required conditions
Test / build-linux (namespace-profile-ghostty-md) (push) Blocked by required conditions
Test / build-linux (namespace-profile-ghostty-md-arm64) (push) Blocked by required conditions
Test / build-linux-libghostty (push) Blocked by required conditions
Test / build-nix (namespace-profile-ghostty-md) (push) Blocked by required conditions
Test / build-nix (namespace-profile-ghostty-md-arm64) (push) Blocked by required conditions
Test / build-snap (namespace-profile-ghostty-snap-arm64) (push) Blocked by required conditions
Test / build-windows (push) Blocked by required conditions
Test / build-windows-cross (namespace-profile-ghostty-md, x86-windows-gnu) (push) Blocked by required conditions
Test / build-windows-cross (namespace-profile-ghostty-md, x86_64-windows-gnu) (push) Blocked by required conditions
Test / test (push) Waiting to run
Test / GTK x11=false wayland=false (push) Blocked by required conditions
Test / GTK x11=true wayland=false (push) Blocked by required conditions
Test / GTK x11=false wayland=true (push) Blocked by required conditions
Test / GTK x11=true wayland=true (push) Blocked by required conditions
Test / Build -Dsentry=false (push) Blocked by required conditions
XTGETTCAP queries are a semicolon-delimited list of hex encoded terminfo capability names. Ghostty encodes a map using upper case hex encodings, meaning when an application uses a lower case encoding the capability is not found. To fix, we convert the entire list we receive in the query to upper case prior to processing further. Fixes: #7229
This commit is contained in:
commit
b3edc88010
@ -162,7 +162,12 @@ pub const Handler = struct {
|
||||
break :tmux .{ .tmux = .{ .exit = {} } };
|
||||
},
|
||||
|
||||
.xtgettcap => |list| .{ .xtgettcap = .{ .data = list } },
|
||||
.xtgettcap => |list| xtgettcap: {
|
||||
for (list.items, 0..) |b, i| {
|
||||
list.items[i] = std.ascii.toUpper(b);
|
||||
}
|
||||
break :xtgettcap .{ .xtgettcap = .{ .data = list } };
|
||||
},
|
||||
|
||||
.decrqss => |buffer| .{ .decrqss = switch (buffer.len) {
|
||||
0 => .none,
|
||||
@ -306,6 +311,21 @@ test "XTGETTCAP command" {
|
||||
try testing.expect(cmd.xtgettcap.next() == null);
|
||||
}
|
||||
|
||||
test "XTGETTCAP mixed case" {
|
||||
const testing = std.testing;
|
||||
const alloc = testing.allocator;
|
||||
|
||||
var h: Handler = .{};
|
||||
defer h.deinit();
|
||||
try testing.expect(h.hook(alloc, .{ .intermediates = "+", .final = 'q' }) == null);
|
||||
for ("536d756C78") |byte| _ = h.put(byte);
|
||||
var cmd = h.unhook().?;
|
||||
defer cmd.deinit();
|
||||
try testing.expect(cmd == .xtgettcap);
|
||||
try testing.expectEqualStrings("536D756C78", cmd.xtgettcap.next().?);
|
||||
try testing.expect(cmd.xtgettcap.next() == null);
|
||||
}
|
||||
|
||||
test "XTGETTCAP command multiple keys" {
|
||||
const testing = std.testing;
|
||||
const alloc = testing.allocator;
|
||||
@ -333,7 +353,7 @@ test "XTGETTCAP command invalid data" {
|
||||
var cmd = h.unhook().?;
|
||||
defer cmd.deinit();
|
||||
try testing.expect(cmd == .xtgettcap);
|
||||
try testing.expectEqualStrings("who", cmd.xtgettcap.next().?);
|
||||
try testing.expectEqualStrings("WHO", cmd.xtgettcap.next().?);
|
||||
try testing.expectEqualStrings("536D756C78", cmd.xtgettcap.next().?);
|
||||
try testing.expect(cmd.xtgettcap.next() == null);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user