Projects STRLCPY alacritty Commits ea93d7f4
🤬
  • Fix bracketed paste with EOT payload

    This works around an issue in many (all?) shells where the bracketed
    paste logic would only strip out `\r` but interpret EOT (`\x03`) as a
    termination of the bracketed paste.
  • Loading...
  • Christian Duerr committed 1 year ago
    ea93d7f4
    1 parent e292aedf
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    CHANGELOG.md
    skipped 46 lines
    47 47  - Redraw hanging until a keypress on X11 in rare cases
    48 48  - Window clipping when maximizing a window without decorations on Windows
    49 49  - Quadrants not aligned with half blocks with built-in font
     50 +- EOT (`\x03`) escaping bracketed paste mode
    50 51   
    51 52  ### Removed
    52 53   
    skipped 1069 lines
  • ■ ■ ■ ■ ■
    alacritty/src/event.rs
    skipped 789 lines
    790 790   }
    791 791   } else if self.terminal().mode().contains(TermMode::BRACKETED_PASTE) {
    792 792   self.write_to_pty(&b"\x1b[200~"[..]);
    793  - self.write_to_pty(text.replace('\x1b', "").into_bytes());
     793 + 
     794 + // Write filtered escape sequences.
     795 + //
     796 + // We remove `\x1b` to ensure it's impossible for the pasted text to write the bracketed
     797 + // paste end escape `\x1b[201~` and `\x03` since some shells incorrectly terminate
     798 + // bracketed paste on its receival.
     799 + let filtered = text.replace('\x1b', "").replace('\x03', "");
     800 + self.write_to_pty(filtered.into_bytes());
     801 + 
    794 802   self.write_to_pty(&b"\x1b[201~"[..]);
    795 803   } else {
    796 804   // In non-bracketed (ie: normal) mode, terminal applications cannot distinguish
    skipped 906 lines
Please wait...
Page is in error, reload to recover