mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-25 00:35:23 +00:00
Move paste encoding to the input package, test, optimize away one alloc
This moves our paste logic to `src/input` in preparation for exposing this as part of libghostty-vt. This yields an immediate benefit of unit tests for paste encoding. Additionally, we were able to remove one allocation on every unbracketed paste path unless the input specifically contains a newline. Unlikely to be noticable, but nice. NOTE: This also includes one change in behavior: we no longer encode `\r\n` and a single `\r`, but as a duplicate `\r\r`. This matches xterm behavior and I don't think will result in any issues since duplicate carriage returns should do nothing in well-behaved terminals.
This commit is contained in:
@@ -9,6 +9,7 @@ pub const command = @import("input/command.zig");
|
||||
pub const function_keys = @import("input/function_keys.zig");
|
||||
pub const keycodes = @import("input/keycodes.zig");
|
||||
pub const kitty = @import("input/kitty.zig");
|
||||
pub const paste = @import("input/paste.zig");
|
||||
|
||||
pub const ctrlOrSuper = key.ctrlOrSuper;
|
||||
pub const Action = key.Action;
|
||||
|
||||
Reference in New Issue
Block a user