First, I guess it only happened on my old machine:
Debian 11 (bullseye), self build libxft.
When paste mouse selection, vim receive control character first.
Which cause vim switch to command mode before paste context.
It is bracketed paste mode from xterm, vim supported it since 8.
vim need to recognize terminal as xterm to activate the support.
Add this setting in vimrc solve the problem:
set term=xterm-256color
There's another issue, perhaps only on my machine too.
The clear command and Ctrl-L only move cursor to top without clear screen.
I copy/paste st.c -> csihandle() -> case 'J' -> case 2 to case 3.
Somehow it works.
These two issue may not be necessary to fix in code. But still worth be recorded here.
First, I guess it only happened on my old machine: Debian 11 (bullseye), self build libxft.
When paste mouse selection, vim receive control character first. Which cause vim switch to command mode before paste context.
It is bracketed paste mode from xterm, vim supported it since 8. vim need to recognize terminal as xterm to activate the support. Add this setting in vimrc solve the problem:
set term=xterm-256color
There's another issue, perhaps only on my machine too. The clear command and Ctrl-L only move cursor to top without clear screen. I copy/paste st.c -> csihandle() -> case 'J' -> case 2 to case 3. Somehow it works.
These two issue may not be necessary to fix in code. But still worth be recorded here.