hotfix: do not send bracketed paste to panes where it is not on
This commit is contained in:
parent
12cb2cf0fa
commit
08d2014cfe
2 changed files with 5 additions and 3 deletions
|
|
@ -63,6 +63,8 @@ impl InputHandler {
|
||||||
let mut err_ctx = OPENCALLS.with(|ctx| *ctx.borrow());
|
let mut err_ctx = OPENCALLS.with(|ctx| *ctx.borrow());
|
||||||
err_ctx.add_call(ContextType::StdinHandler);
|
err_ctx.add_call(ContextType::StdinHandler);
|
||||||
let alt_left_bracket = vec![27, 91];
|
let alt_left_bracket = vec![27, 91];
|
||||||
|
let bracketed_paste_start = vec![27, 91, 50, 48, 48, 126]; // \u{1b}[200~
|
||||||
|
let bracketed_paste_end = vec![27, 91, 50, 48, 49, 126]; // \u{1b}[201~
|
||||||
if self.options.mouse_mode.unwrap_or(true) {
|
if self.options.mouse_mode.unwrap_or(true) {
|
||||||
self.os_input.enable_mouse();
|
self.os_input.enable_mouse();
|
||||||
}
|
}
|
||||||
|
|
@ -97,7 +99,9 @@ impl InputHandler {
|
||||||
}
|
}
|
||||||
Ok((InputInstruction::PastedText(raw_bytes), _error_context)) => {
|
Ok((InputInstruction::PastedText(raw_bytes), _error_context)) => {
|
||||||
if self.mode == InputMode::Normal || self.mode == InputMode::Locked {
|
if self.mode == InputMode::Normal || self.mode == InputMode::Locked {
|
||||||
|
self.dispatch_action(Action::Write(bracketed_paste_start.clone()));
|
||||||
self.dispatch_action(Action::Write(raw_bytes));
|
self.dispatch_action(Action::Write(raw_bytes));
|
||||||
|
self.dispatch_action(Action::Write(bracketed_paste_end.clone()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok((InputInstruction::SwitchToMode(input_mode), _error_context)) => {
|
Ok((InputInstruction::SwitchToMode(input_mode), _error_context)) => {
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,10 @@ pub(crate) fn stdin_loop(
|
||||||
|
|
||||||
if key_event == bracketed_paste_start {
|
if key_event == bracketed_paste_start {
|
||||||
pasting = true;
|
pasting = true;
|
||||||
pasted_text.append(&mut raw_bytes);
|
|
||||||
continue;
|
continue;
|
||||||
} else if pasting && key_event == bracketed_paste_end {
|
} else if pasting && key_event == bracketed_paste_end {
|
||||||
pasting = false;
|
pasting = false;
|
||||||
let mut pasted_text: Vec<u8> = pasted_text.drain(..).collect();
|
let pasted_text: Vec<u8> = pasted_text.drain(..).collect();
|
||||||
pasted_text.append(&mut raw_bytes);
|
|
||||||
send_input_instructions
|
send_input_instructions
|
||||||
.send(InputInstruction::PastedText(pasted_text))
|
.send(InputInstruction::PastedText(pasted_text))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue