mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-21 11:16:08 +03:00
input: keypad enter should act as normal "\r" if no other seq matches
This matches Kitty behavior on both macOS and Linux. In certain keyboard modes and Kitty keyboard modes, the behavior changes but those already matched (tested).
This commit is contained in:
@ -1042,6 +1042,20 @@ test "legacy: shift+function key should use all mods" {
|
||||
try testing.expectEqualStrings("\x1b[1;2A", actual);
|
||||
}
|
||||
|
||||
test "legacy: keypad enter" {
|
||||
var buf: [128]u8 = undefined;
|
||||
var enc: KeyEncoder = .{
|
||||
.event = .{
|
||||
.key = .kp_enter,
|
||||
.mods = .{},
|
||||
.consumed_mods = .{},
|
||||
},
|
||||
};
|
||||
|
||||
const actual = try enc.legacy(&buf);
|
||||
try testing.expectEqualStrings("\r", actual);
|
||||
}
|
||||
|
||||
test "ctrlseq: normal ctrl c" {
|
||||
const seq = ctrlSeq(.c, .{ .ctrl = true });
|
||||
try testing.expectEqual(@as(u8, 0x03), seq.?);
|
||||
|
@ -116,7 +116,7 @@ pub const keys = keys: {
|
||||
result.set(.kp_multiply, kpDefault("j") ++ pcStyle("\x1bO{}j"));
|
||||
result.set(.kp_subtract, kpDefault("m") ++ pcStyle("\x1bO{}m"));
|
||||
result.set(.kp_add, kpDefault("k") ++ pcStyle("\x1bO{}k"));
|
||||
result.set(.kp_enter, kpDefault("M") ++ pcStyle("\x1bO{}M"));
|
||||
result.set(.kp_enter, kpDefault("M") ++ pcStyle("\x1bO{}M") ++ .{.{ .sequence = "\r" }});
|
||||
|
||||
result.set(.backspace, &.{
|
||||
// Modify Keys Normal
|
||||
|
Reference in New Issue
Block a user