dit icon indicating copy to clipboard operation
dit copied to clipboard

Copy and paste from Dit from and to outside

Open ooker777 opened this issue 10 years ago • 6 comments

Hi, I would like to copy a word or phrase from Dit to other application, such as Firefox and vice versa. Is there a way to do so?

Thank you.

ooker777 avatar May 22 '14 21:05 ooker777

You can copy and paste to/from ncurses applications such as Dit holding the Shift and selecting to copy, and holding Shift and pressing the middle button of the mouse to paste. (I think this can vary from terminal to terminal.)

hishamhm avatar May 23 '14 21:05 hishamhm

No, I mean the shortcut to cut, copy and paste. In Dit, when I use Ctrl+Shift+C to copy then paste to outside it (Firefox for example), the only sequence I get is ********. Copy text from outside then paste it on Dit by using Ctrl+Shift+V works as

expected.

Ooker.

You can copy and paste to/from ncurses applications such as Dit holding the Shift and selecting to copy, and holding Shift and pressing the middle button of the mouse to paste. (I think this can vary from terminal to terminal.) —Reply to this email directly or view it on GitHub[1].[2]


[1] https://github.com/hishamhm/dit/issues/9#issuecomment-44064821 [2] https://github.com/notifications/beacon/6695517__eyJzY29wZSI6Ik5ld3NpZXM6Q mVhY29uIiwiZXhwaXJlcyI6MTcxNjUwMTMxNCwiZGF0YSI6eyJpZCI6MzI5MDY0Mz J9fQ==--137a29eaa226a2d54b265ef65615a17ead75d38a.gif

ooker777 avatar May 24 '14 02:05 ooker777

That's because Ctrl+Shift+C and Ctrl+Shfit+V are provided by your terminal, not by Dit.

There's a "hidden" feature to workaround this, but it's not enabled by default. Edit dit.c and change static int xclipOk = 0 to static int xclipOk = 1; then install the xclip application and see if Ctrl+C copies to the X11 clipboard as you'd like. If it doesn't change, popen("xclip -i 2> /dev/null", "w") to popen("xclip -i -selection clipboard 2> /dev/null", "w")

Let me know your results!

hishamhm avatar May 24 '14 02:05 hishamhm

The result is better. The pasted text is not "*******" anymore. However sometimes I

can only paste from Dit to the outside, sometimes reverse work, not both of them.

Ooker.

That's because Ctrl+Shift+C and Ctrl+Shfit+V are provided by your terminal, not by Dit. There's a "hidden" feature to workaround this, but it's not enabled by default. Edit dit.c and change static int xclipOk = 0 to static int xclipOk = 1; then install the xclip application and see if Ctrl+C copies to the X11 clipboard as you'd like. If it doesn't change, popen("xclip -i 2> /dev/null", "w") to popen("xclip -i -selection clipboard 2> /dev/null", "w") Let me know your results! —Reply to this email directly or view it on GitHub[1].[2]


[1] https://github.com/hishamhm/dit/issues/9#issuecomment-44075416 [2] https://github.com/notifications/beacon/6695517__eyJzY29wZSI6Ik5ld3NpZXM6Q mVhY29uIiwiZXhwaXJlcyI6MTcxNjUxNzcxNiwiZGF0YSI6eyJpZCI6MzI5MDY0MzJ9 fQ==--cfc7941dfadf056e217933cc6c60989eb22637ae.gif

ooker777 avatar May 24 '14 02:05 ooker777

I have some ideas how to improve this, but for now you'll have to use Ctrl+Shift+V to paste from the outside world; Ctrl+V will only paste the last thing copied from inside Dit.

hishamhm avatar May 24 '14 03:05 hishamhm

OK, I'll wait for the next release, thank you so much :D

Ooker.

I have some ideas how to improve this, but for now you'll have to use Ctrl+Shift+V to paste from the outside world; Ctrl+V will only paste the last thing copied from inside Dit. —Reply to this email directly or view it on GitHub[1].[2]


[1] https://github.com/hishamhm/dit/issues/9#issuecomment-44076289 [2] https://github.com/notifications/beacon/6695517__eyJzY29wZSI6Ik5ld3NpZXM6Q mVhY29uIiwiZXhwaXJlcyI6MTcxNjUyMDU4MCwiZGF0YSI6eyJpZCI6MzI5MDY0Mz J9fQ==--2c4f1e97eb623e998acc9fc28a5d8bbccca4a334.gif

ooker777 avatar May 24 '14 04:05 ooker777