-
Notifications
You must be signed in to change notification settings - Fork 74
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 #38
Comments
Same problem. The error appears when system clipboard contains non-string value (file for example). My proposal is to print something like "Binary data" rather an error. |
I'm unsure if this is related, but when I yank to |
Nevermind, my issues were due to https://wiki.ubuntu.com/ClipboardPersistence. |
Fix the issue astrand#38 (astrand#38). Add a prefix "xclip::Error" with the error message so that the user can know what program is causing the error. Print the id of the owner of the selection in the verbose mode so that the developer can know what program cannot fulfill the request of ConvertSelection.
Fix the issue astrand#38 (astrand#38). 1).Add a prefix "xclip: Error: " with all error messages so that the user can know what program is causing the error. 2).Add a function errconvsel() for failure of ConvertSelection. It also prints the id of the owner of the selection so that the user can know what program cannot fulfill the request of ConvertSelection.
Fix the issue astrand#38 (astrand#38). 1).Add a prefix "xclip: Error: " with all error messages so that the user can know what program is causing the error. 2).Add a function errconvsel() for failure of ConvertSelection. It also prints the id of the owner of the selection so that the user can know what program cannot fulfill the request of ConvertSelection.
I've merged in @hwangcc23 's fix for this issue which makes the error message more explicit about what the problem is. However, if the "solution" people want is to set the clipboard so any random string as suggested by the original report:
then perhaps what is actually needed is for xclip to not be so verbose about errors. It can simply return an error if a target isn't available and not print anything unless -verbose is given. What do people think? |
Alternately, we could add an option to make even error messages not be printed out and then ask the The only problem is I'm not sure what that option would be called. We already used "-silent" to mean show error messages but nothing else and "-quiet" to mean be slightly more verbose than -silent and also run in the foreground. Perhaps those options should be renamed? "-silent" could be called "-background" or "-normal" and "-quiet" could be changed to "-foreground". |
I'm not sure how this is relevant, but i've been stumped by a similar issue when using xclip inside Emacs' eshell shell interpreter. E.g.:
Errors out with 'Error: target STRING not available' While if i do:
I get Is this relevant to this issue? |
Any progress on this? getting a related issue with nvim. |
@polezaivsani Your issue is relevant in that it appears the "error" is that xclip is reporting an error. I asked what people thought about this almost a year ago:
I didn't get any response, which I suppose is appropriate as that seems to be the correct solution: say nothing. 😂 @astrand I propose the following when a TARGET is not available:
I say "informational" instead of "error" message so that we can silence it using command line options. (Xclip has no way to suppress error messages). Does that sound good? Eventually, we should clean up the
|
the bug affect neovim/neovim#20862 $ touch a
$ xsel -ib < a
$ xsel -ob
$ xclip -o -selection clipboard
Error: target STRING not available |
Problem: xclip is not actively maintained compared to xsel, and it has a bug: $ touch a $ xsel -ib < a $ xsel -ob $ xclip -o -selection clipboard Error: target STRING not available Years ago, the situation was reversed. We originally preferred xsel 46bd3c0 but then swapped to xclip 799d9c3 to work around #7237 (comment) Solution: Prefer xsel again. close #20862 ref #9302 ref astrand/xclip#38
Problem: xclip is not actively maintained compared to xsel, and it has a bug: $ touch a $ xsel -ib < a $ xsel -ob $ xclip -o -selection clipboard Error: target STRING not available Years ago, the situation was reversed. We originally preferred xsel 46bd3c0 but then swapped to xclip 799d9c3 to work around neovim#7237 (comment) Solution: Prefer xsel again. close neovim#20862 ref neovim#9302 ref astrand/xclip#38
Came here after googling. Probably, could be helpful for someone. I had the similar issue with my clipboard editor.
Adding
|
Hello,
Many times, I end up with random error messages in my terminal like:
Turns out that
xclip
is causing those. So first off, these error messages should be prefixed with something likexclip::
so that the users know what's causing those.. below would be so much better:Can that error be fixed. The simple workaround I need to use each time that happens is
echo foo | xclip -i
. I wish one didn't need to do that.We can see how confusing this error is based on following Google search results:
The text was updated successfully, but these errors were encountered: