Closed unxed closed 3 years ago
It is currently not possible to detect a 'paste' event from the terminal (except system clipboard, #2). It would be first necessary to add non-blocking event look-ahead support in Turbo Vision.
A terrible workaround would be to measure the time between text events in order to make an approximate 'paste' detection.
A terrible workaround would be to measure the time between text events in order to make an approximate 'paste' detection.
Not so terrible, Midnight Commander is doing just the same to prevent the need of pressing ESC twice.
I am very obstinate, so instead of doing the timing hack I ended up implementing non-blocking event reads in Turbo Vision to make this feature possible.
Tested. Working. Cool!
This is now also implemented in tvedit
(as of https://github.com/magiblot/tvision/commit/f8a994f1be9d48aa7ff48847145ce58d0115d4c9).
It turns out that there is a standard solution to this problem, supported by most terminals: https://en.wikipedia.org/wiki/Bracketed-paste https://invisible-island.net/xterm/xterm-paste64.html
...or some text is being pasted with unnecessary spaces (this sample is copied from turbo's readme on github in firefox):