LibVT: Implement Bracketed Paste Mode

This mode allow us to escape any data that was not directly typed by the
user. `vim` currently uses this. If we implement it in the shell, we
could prevent newlines from being injected into the shell by pasting
text or dragging files into it (see #7276).
This commit is contained in:
Daniel Bertalan 2021-05-24 12:01:59 +02:00 committed by Ali Mohammad Pur
commit 708f835477
Notes: sideshowbarker 2024-07-18 17:27:56 +09:00
4 changed files with 53 additions and 12 deletions

View file

@ -105,6 +105,10 @@ void Terminal::alter_mode(bool should_set, Parameters params, Intermediates inte
m_client.set_cursor_style(None);
}
break;
case 2004:
dbgln_if(TERMINAL_DEBUG, "Setting bracketed mode enabled={}", should_set);
m_needs_bracketed_paste = should_set;
break;
default:
dbgln("Terminal::alter_mode: Unimplemented private mode {} (should_set={})", mode, should_set);
break;