Closed aqjune closed 4 months ago
Can you please share the exact setup in which this happens ? Since v0.2.0 down
should implement bracketed pastes see https://github.com/dbuenzli/down/issues/16. But maybe your terminal doesn't support them (or there is an issue in the implemetation).
In fact there an easy way to find out. Have something in your clipboard. For example This is too slow
.
Now in the REPL do a:
# Down.Private.tty_test ();;
if when you paste you get:
"This is too slow"
then your terminal supports bracketed pastes.
If not you will get:
"T"
"h"
"i"
"s"
" "
"i"
"s"
" "
"t"
"o"
"o"
" "
"s"
"l"
"o"
"w"
I am running OCaml REPL on WSL2 and VSCode terminal, According to your test it seems both of these don't support bracketed paste. It was valuable information, thanks for the pointer.
--
Actually, in the VSCode terminal case, the reason seems to be related to the fact that the OCaml REPL process was not a 'plain' one, but one revived from a process-checkpointing tool. VSCode terminal indeed supports bracketed paste. WSL2 terminal does not support bracketed paste though. The process checkpointing was done on WSL2 terminal, so its bracketed paste behavior might be inherited from the property of WSL2 terminal.
--
For anyone who is interested in this issue, this is my record:
set enable-bracketed-paste on
to ~/.inputrc
(read this doc) Also, you can check the option using bind -V | grep enable-bracketed-paste
.while true; do
bind -V | grep enable-bracketed-paste
sleep 1
done
ocamlrun
that cannot restore the bracketed paste option when the process is checkpointed and restored.Thanks for the details !
Hi all,
I found
down
was a useful tool for developing on OCaml REPL, thanks!So far everything was great, but one glitch that I've found was a long latency when pasting a long text consisting of multiple number of lines.
When the pasted text has multiple lines of code which is more than the number of lines of a terminal screen, the pasting speed is slow and takes a significant amount of time compared to the original OCaml REPL.
I will be happy if the latency issue is fixed, thanks