Terminal compatibility: forward OSC52 events (#1644)
Fixes #1199 Co-authored-by: Christian Schubert <christian.schubert01@sap.com>
This commit is contained in:
parent
018d32e997
commit
2cb6e20d62
3 changed files with 19 additions and 2 deletions
|
|
@ -342,6 +342,7 @@ pub struct Grid {
|
|||
scrollback_buffer_lines: usize,
|
||||
pub mouse_mode: bool,
|
||||
pub search_results: SearchResult,
|
||||
pub pending_clipboard_update: Option<String>,
|
||||
}
|
||||
|
||||
impl Debug for Grid {
|
||||
|
|
@ -447,6 +448,7 @@ impl Grid {
|
|||
character_cell_size,
|
||||
search_results: Default::default(),
|
||||
sixel_grid,
|
||||
pending_clipboard_update: None,
|
||||
}
|
||||
}
|
||||
pub fn render_full_viewport(&mut self) {
|
||||
|
|
@ -1890,8 +1892,12 @@ impl Perform for Grid {
|
|||
b"?" => {
|
||||
// TBD: paste from own clipboard - currently unsupported
|
||||
},
|
||||
_base64 => {
|
||||
// TBD: copy to own clipboard - currently unsupported
|
||||
base64 => {
|
||||
if let Ok(bytes) = base64::decode(base64) {
|
||||
if let Ok(string) = String::from_utf8(bytes) {
|
||||
self.pending_clipboard_update = Some(string);
|
||||
}
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -484,6 +484,10 @@ impl Pane for TerminalPane {
|
|||
self.grid.pending_messages_to_pty.drain(..).collect()
|
||||
}
|
||||
|
||||
fn drain_clipboard_update(&mut self) -> Option<String> {
|
||||
self.grid.pending_clipboard_update.take()
|
||||
}
|
||||
|
||||
fn start_selection(&mut self, start: &Position, _client_id: ClientId) {
|
||||
self.grid.start_selection(start);
|
||||
self.set_should_render(true);
|
||||
|
|
|
|||
|
|
@ -258,6 +258,9 @@ pub trait Pane {
|
|||
// we should probably refactor away from this trait at some point
|
||||
vec![]
|
||||
}
|
||||
fn drain_clipboard_update(&mut self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
fn render_full_viewport(&mut self) {}
|
||||
fn relative_position(&self, position_on_screen: &Position) -> Position {
|
||||
position_on_screen.relative_to(self.get_content_y(), self.get_content_x())
|
||||
|
|
@ -955,9 +958,13 @@ impl Tab {
|
|||
{
|
||||
terminal_output.handle_pty_bytes(bytes);
|
||||
let messages_to_pty = terminal_output.drain_messages_to_pty();
|
||||
let clipboard_update = terminal_output.drain_clipboard_update();
|
||||
for message in messages_to_pty {
|
||||
self.write_to_pane_id(message, PaneId::Terminal(pid));
|
||||
}
|
||||
if let Some(string) = clipboard_update {
|
||||
self.write_selection_to_clipboard(&string);
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn write_to_terminals_on_current_tab(&mut self, input_bytes: Vec<u8>) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue