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

Global hook to yank operations with xclip hangs xclip and kakoune #2325

Closed
hacktivista opened this issue Aug 22, 2018 · 6 comments
Closed

Global hook to yank operations with xclip hangs xclip and kakoune #2325

hacktivista opened this issue Aug 22, 2018 · 6 comments

Comments

@hacktivista
Copy link
Contributor

hacktivista commented Aug 22, 2018

Steps

Use the following hook in your kakrc

hook global NormalKey y|d|c %{ nop %sh{
  printf %s "$kak_main_reg_dquote" | xclip -i -selection clipboard
}}

Outcome

When you yank something, kakoune displays the message waiting for shell command to finish, but command "never finishes", indeed if you ps you can see that xclip is running. No *debug* information is provided.

Expected

It should copy the contents into X clipboard "immediately"

I think it probably has more to do with xclip than with kakoune, but knowing why this happens would be of great help (or in the worst case, say that it will not work in wiki).

@hacktivista hacktivista changed the title Global hook to yank operations hangs xclip Global hook to yank operations with xclip hangs xclip and kakoune Aug 22, 2018
@lenormf
Copy link
Contributor

lenormf commented Aug 22, 2018

Have you tried running xclip with the -verbose flag, see what it's doing?

You could also add set +x do your shell scope, and check the *debug* buffer, and run the exact same command from a shell, to see if you can reproduce the issue.

What version of xclip are you using?

@maximbaz
Copy link
Contributor

That's know issue of xclip, see here for example: asweigart/pyperclip#116 (comment)

See if workarounds like -f or >/dev/null help, or just use xsel.

@hacktivista
Copy link
Contributor Author

@maximbaz you're right, I didn't notice that it was actually copying contents to clipboard until I stop the process. It's curious that the same does not happen with xsel, which works in a similar fashion.

@mawww
Copy link
Owner

mawww commented Sep 3, 2018

I dont think there is anything that we can fix in Kakoune itself for that, closing.

@mawww mawww closed this as completed Sep 3, 2018
@aeosynth
Copy link

for reference, xclip issues:

astrand/xclip#34
astrand/xclip#20

@ljrk0
Copy link

ljrk0 commented Sep 3, 2020

Closing stdout & stderr seems to do the trick (also updated the Wiki):

xclip -in -selection clipboard >&- 2>&-

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

6 participants