Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy and paste from Dit from and to outside #9

Open
ooker777 opened this issue May 22, 2014 · 6 comments
Open

Copy and paste from Dit from and to outside #9

ooker777 opened this issue May 22, 2014 · 6 comments

Comments

@ooker777
Copy link

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.

@hishamhm
Copy link
Owner

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.)

@ooker777
Copy link
Author

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] #9 (comment)
[2]
https://github.com/notifications/beacon/6695517__eyJzY29wZSI6Ik5ld3NpZXM6Q
mVhY29uIiwiZXhwaXJlcyI6MTcxNjUwMTMxNCwiZGF0YSI6eyJpZCI6MzI5MDY0Mz
J9fQ==--137a29eaa226a2d54b265ef65615a17ead75d38a.gif

@hishamhm
Copy link
Owner

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!

@ooker777
Copy link
Author

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] #9 (comment)
[2]
https://github.com/notifications/beacon/6695517__eyJzY29wZSI6Ik5ld3NpZXM6Q
mVhY29uIiwiZXhwaXJlcyI6MTcxNjUxNzcxNiwiZGF0YSI6eyJpZCI6MzI5MDY0MzJ9
fQ==--cfc7941dfadf056e217933cc6c60989eb22637ae.gif

@hishamhm
Copy link
Owner

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.

@ooker777
Copy link
Author

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] #9 (comment)
[2]
https://github.com/notifications/beacon/6695517__eyJzY29wZSI6Ik5ld3NpZXM6Q
mVhY29uIiwiZXhwaXJlcyI6MTcxNjUyMDU4MCwiZGF0YSI6eyJpZCI6MzI5MDY0Mz
J9fQ==--2c4f1e97eb623e998acc9fc28a5d8bbccca4a334.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants