Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/terminal/osc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ pub const Command = union(Key) {

kitty_clipboard_protocol: KittyClipboardProtocol,

/// Kitty drag and drop protocol (OSC 72)
kitty_dnd_protocol: KittyDndProtocol,

/// OSC 3008. Hierarchical context signalling (UAPI spec).
/// https://uapi-group.org/specifications/specs/osc_context/
context_signal: parsers.context_signal.Command,
Expand All @@ -164,6 +167,8 @@ pub const Command = union(Key) {

pub const KittyClipboardProtocol = parsers.kitty_clipboard_protocol.OSC;

pub const KittyDndProtocol = parsers.kitty_dnd_protocol.OSC;

pub const Key = LibEnum(
lib.target,
// NOTE: Order matters, see LibEnum documentation.
Expand Down Expand Up @@ -192,6 +197,7 @@ pub const Command = union(Key) {
"conemu_comment",
"kitty_text_sizing",
"kitty_clipboard_protocol",
"kitty_dnd_protocol",
"context_signal",
},
);
Expand Down Expand Up @@ -344,6 +350,7 @@ pub const Parser = struct {
@"52",
@"55",
@"66",
@"72",
@"77",
@"104",
@"110",
Expand Down Expand Up @@ -421,6 +428,7 @@ pub const Parser = struct {
.show_desktop_notification,
.kitty_text_sizing,
.kitty_clipboard_protocol,
.kitty_dnd_protocol,
.context_signal,
=> {},
}
Expand Down Expand Up @@ -691,10 +699,16 @@ pub const Parser = struct {

.@"7" => switch (c) {
';' => self.captureTrailing(.fixed),
'2' => self.state = .@"72",
'7' => self.state = .@"77",
else => self.state = .invalid,
},

.@"72" => switch (c) {
';' => self.captureTrailing(.allocating),
else => self.state = .invalid,
},

.@"77" => switch (c) {
'7' => self.state = .@"777",
else => self.state = .invalid,
Expand Down Expand Up @@ -805,6 +819,8 @@ pub const Parser = struct {

.@"66" => parsers.kitty_text_sizing.parse(self, terminator_ch),

.@"72" => parsers.kitty_dnd_protocol.parse(self, terminator_ch),

.@"77" => null,

.@"133" => parsers.semantic_prompt.parse(self, terminator_ch),
Expand Down
1 change: 1 addition & 0 deletions src/terminal/osc/parsers.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub const hyperlink = @import("parsers/hyperlink.zig");
pub const iterm2 = @import("parsers/iterm2.zig");
pub const kitty_clipboard_protocol = @import("parsers/kitty_clipboard_protocol.zig");
pub const kitty_color = @import("parsers/kitty_color.zig");
pub const kitty_dnd_protocol = @import("parsers/kitty_dnd_protocol.zig");
pub const kitty_text_sizing = @import("parsers/kitty_text_sizing.zig");
pub const mouse_shape = @import("parsers/mouse_shape.zig");
pub const osc9 = @import("parsers/osc9.zig");
Expand Down
Loading
Loading