File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,7 +83,14 @@ fn parseControl(c: u8) KeyEvent {
8383 return switch (c ) {
8484 0 = > .{ .key = .null_key , .modifiers = .{ .ctrl = true } },
8585 9 = > .{ .key = .tab },
86- 10 , 13 = > .{ .key = .enter },
86+ // In raw mode 0x0a is sent by the terminal itself
87+ // Some editor-integrated terminals (Zed, possibly VSCode) use this
88+ // historical CR/LF split to encode Shift+Enter without a richer
89+ // keyboard protocol -- plain Enter sends 0x0d, Shift+Enter sends
90+ // 0x0a. Mapping LF onto Enter+Shift recovers the modifier, ensuring
91+ // consistent behavior to other TUI applications / libraries.
92+ 10 = > .{ .key = .enter , .modifiers = .{ .shift = true } },
93+ 13 = > .{ .key = .enter },
8794 27 = > .{ .key = .escape },
8895 1... 8, 11 , 12 , 14... 26 = > .{
8996 .key = .{ .char = 'a' + c - 1 },
You can’t perform that action at this time.
0 commit comments