1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

Fix Bracketed Paste Mode when input contains end sequence. (#1243)

* Fix Bracketed Paste Mode when input contains end sequence.
* Remove \x1b instead of just the paste end sequence.
This commit is contained in:
Aidan Epstein 2018-09-20 14:58:57 +00:00 committed by Joe Wilm
parent 177a5c39c3
commit 417ad9d430

View file

@ -285,7 +285,7 @@ impl Action {
fn paste<A: ActionContext>(&self, ctx: &mut A, contents: String) { fn paste<A: ActionContext>(&self, ctx: &mut A, contents: String) {
if ctx.terminal_mode().contains(TermMode::BRACKETED_PASTE) { if ctx.terminal_mode().contains(TermMode::BRACKETED_PASTE) {
ctx.write_to_pty(&b"\x1b[200~"[..]); ctx.write_to_pty(&b"\x1b[200~"[..]);
ctx.write_to_pty(contents.into_bytes()); ctx.write_to_pty(contents.replace("\x1b","").into_bytes());
ctx.write_to_pty(&b"\x1b[201~"[..]); ctx.write_to_pty(&b"\x1b[201~"[..]);
} else { } else {
// In non-bracketed (ie: normal) mode, terminal applications cannot distinguish // In non-bracketed (ie: normal) mode, terminal applications cannot distinguish