Closed groner closed 1 year ago
At any rate, it is very surprising that wl-paste is inferring the type of data I want based on whether stdout is a file or not.
It's doing much more than that. Try copying an image from your browser, and then wl-pasting it > image.png
and > image.jpg
So what happens here is wl-paste thinks that a file named github.com
is supposed to be an application/x-msdos-program
(see grep -w com /etc/mime.types
), and since there's no such type in the clipboard, it errors out. This would still work (and paste as text) if it thought the format you wanted was textual, but alas, DOS COM files are binary.
The exact logic for picking the type to paste is:
You can always disable this type inference magic by specifying an explicit type (--type text/plain
).
That is pretty nifty.
Could there be a diagnostic about what it's trying to do that didn't work?
No application/x-msdos-program type offered. Did you mean to specify --type text/plain?
Something like this would have saved me a considerable amount of time trying to understand what was happening.
Yes, actually that's a nice idea. Perhaps like this, even:
$ wl-paste --type foo/bar
wl-paste: clipboard content is not available as requested type "foo/bar"
Use "wl-paste --list-types" to view available types.
$ wl-paste > myexe.com
wl-paste: clipboard content is not available as inferred output type "application/x-msdos-program"
Use "wl-paste --list-types" to view available types. Use "--type" to explicitly specify a type.
What do you think?
@bugaevc Your proposed messages look fine to me.
The new error messages have landed; it would be great if you could build wl-clipboard from source and test your specific case.
@bugaevc The updated errors work as expected on my ubuntu 22.10 system.
: kai@dipper wl-clipboard; ./build/src/wl-paste
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
: kai@dipper wl-clipboard; ./build/src/wl-paste > github.com
Clipboard content is not available as inferred output type "application/x-msdos-program"
Use "wl-paste --list-types" to view available types. Use "--type" to explicitly specify a type.
I ran into this when updating my authorized_keys files following the github.com host key change. I'm having trouble reproducing it now, but I have a transcript of the session.
I've trimmed the session down some, but I did reproduce the error several times to confirm it wasn't some chance cosmic ray bit flip thing.
I think I copied from https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints, but I can't reproduce it by copying from there now.
At any rate, it is very surprising that wl-paste is inferring the type of data I want based on whether stdout is a file or not.