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

Error: target STRING not available #87

Open
baditaflorin opened this issue Oct 28, 2020 · 6 comments
Open

Error: target STRING not available #87

baditaflorin opened this issue Oct 28, 2020 · 6 comments

Comments

@baditaflorin
Copy link

I'm getting this error when trying to run xclip in MacosX, using brew install xclip

Also tried this but will never increment even if I do right click copy or Command C to copy to clipboard
xclip -loops 10 -verbose $(pwd)/file.txt
Loops: 10
Connected to X server.
Using UTF8_STRING.
Reading /Users/florin/Coding/LINUX/file.txt...
Waiting for 10 selection requests, Control-C to quit
Waiting for selection request 1 of 10.

@hackerb9
Copy link
Collaborator

Hi!

I don't know how MacOS's clipboard integrates with the X selection, but I seem to recall there was an option to synchronize them in the MacOS X server. Have you looked into that?

It's also possible for STRING to not be available, although that seems unlikely if you've been copying text. Would you please run this and let us know what the output is:

xclip -t TARGETS

As for -loops, it only counts the number of paste requests. When you do a copy with another X application, as you were doing, xclip is supposed to quit even if the number of loops hasn't changed. The fact that it doesn't makes me suspect there is something weird going on with MacOS's clipboard integration with X.

@hackerb9
Copy link
Collaborator

@baditaflorin Did you get it figured out?

@baditaflorin
Copy link
Author

unfortunately no, I did not manage yet to play with it too much.
I do not get anything when running this command. If I start writing, it will add the text, and need to to CTRL+C to quit

xclip -t TARGETS
^C

@hackerb9
Copy link
Collaborator

hackerb9 commented Oct 31, 2020

Oh, I forgot with the older release of xclip that brew likely has, you need to include -o or it will read from stdin. Please try,

xclip -o -t TARGETS

@phillipberndt
Copy link
Contributor

PR #142 might help here. I noticed that some applications require STRING to be set for anything else to work.

@lorenzog
Copy link

While investigating an xclip issue elsewhere I also stumbled upon this bug report.
It seems that certain versions of xclip "wait" for the receiver to specify the acceptable mime types; this causes a problem when the receiver is a pipe. For example, in Debian 13,

$ xclip -version
xclip version 0.13
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL

$ xclip -t TARGETS -o
Error: target TARGETS not available

I suspect this is because the console does not offer any kind of 'targets' to xclip.
The curious matter is that, once I "initialise" the clipboard by copying some text into it from any application, running the command again returns something else:

$ xclip -t TARGETS -o
TIMESTAMP
TARGETS
MULTIPLE
UTF8_STRING
COMPOUND_TEXT
TEXT
STRING
text/plain;charset=utf-8
text/plain

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

4 participants