dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.43k stars 113 forks source link

support bracketed paste mode #2704

Open joseluis opened 1 year ago

joseluis commented 1 year ago

It would be nice to support bracketed paste mode.

This is how crossterm implements it: https://docs.rs/crossterm/0.26.0/src/crossterm/event.rs.html#457-497

dankamongmen commented 1 year ago

hrmmm i thought i looked at this before and concluded it was something to implement in the terminal, not in the termui library. let me take another look...

PerBothner commented 1 year ago

"concluded it was something to implement in the terminal, not in the termui library"

It's both: The library sends an escape sequence to enable bracked paste mode. When enabled, the terminal adds the bracketed-paste delimiters around pasted text. The library has to recognize and remove the delimiters, and treat the result as literal (quoted) text without any commands. Most relevant for vi-style interfaces, but also for newlines: a newline in pasted text should cause a line-break to be inserted - it should not be treated as an "Enter" or "Accept" action.