vaxis: implement bracketed paste
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
parent
400e2d5cac
commit
4c84faddfa
3 changed files with 16 additions and 1 deletions
|
@ -19,7 +19,7 @@ Contributions are welcome.
|
|||
| ------------------------------ | :---: | :------: | :-------: |
|
||||
| RGB | ✅ | ✅ | ✅ |
|
||||
| Hyperlinks | ✅ | planned | ❌ |
|
||||
| Bracketed Paste | ✅ | planned | ❌ |
|
||||
| Bracketed Paste | ✅ | ✅ | ❌ |
|
||||
| Kitty Keyboard | ✅ | ✅ | ✅ |
|
||||
| Styled Underlines | ✅ | ✅ | ✅ |
|
||||
| Mouse Shapes (OSC 22) | ✅ | planned | ❌ |
|
||||
|
|
|
@ -14,9 +14,14 @@ pub const sixel_geometry_query = "\x1b[?2;1;0S";
|
|||
pub const sync_set = "\x1b[?2026h";
|
||||
pub const sync_reset = "\x1b[?2026l";
|
||||
|
||||
// unicode
|
||||
pub const unicode_set = "\x1b[?2027h";
|
||||
pub const unicode_reset = "\x1b[?2027l";
|
||||
|
||||
// bracketed paste
|
||||
pub const bp_set = "\x1b[?2004h";
|
||||
pub const bp_reset = "\x1b[?2004l";
|
||||
|
||||
// Key encoding
|
||||
pub const csi_u_push = "\x1b[>{d}u";
|
||||
pub const csi_u_pop = "\x1b[<u";
|
||||
|
|
|
@ -500,6 +500,16 @@ pub fn Vaxis(comptime T: type) type {
|
|||
.{title},
|
||||
);
|
||||
}
|
||||
|
||||
// turn bracketed paste on or off. An event will be sent at the
|
||||
// beginning and end of a detected paste. All keystrokes between these
|
||||
// events were pasted
|
||||
pub fn bracketedPaste(self: *Self, enable: bool) !void {
|
||||
if (self.tty == null) return;
|
||||
const seq = if (enable) ctlseqs.bp_set else ctlseqs.bp_reset;
|
||||
_ = try self.tty.?.write(seq);
|
||||
try self.tty.?.flush();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue