lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.27k stars 162 forks source link

Multi-line clipboard paste warning feature #415

Open kohnish opened 4 years ago

kohnish commented 4 years ago

Do you think we can implement it? I'm happy to investigate how to do it.

lanoxx commented 4 years ago

There is a function called cpaste in tilda_window.c that invokes the right function in the VTE library to paste the clipboard content. You would probably need to check the current content of the clipboard first using some other means (GTK should have functions to get the clipboard content). If the content is multiline or exceeds a certain number of bytes then you could show a dialog. The whole thing would need to be configurable in the wizard (enable/disable, number of bytes or lines to show a warning). Remember that a user might also be pasting a single line with a large amount of data.

kohnish commented 4 years ago

Thanks for the tip. It seems cpaste is used for ctrl + shift + v paste. I use shift insert / middle click. I guess it is default feature of linux/x/wayland. So I need to somehow capture it before pasting.