wl-clipboard icon indicating copy to clipboard operation
wl-clipboard copied to clipboard

Cannot redirect `wl-paste` to `.sh` file.

Open Rodrigodd opened this issue 1 year ago • 1 comments

Reproduction

  1. Copy any plain text, like the shell code below:
echo "hello $1"
  1. And run
wl-paste > hello.sh

What happens

The command returns:

Clipboard content is not available as inferred output type "application/x-sh"
Use "wl-paste --list-types" to view available types. Use "--type" to explicitly specify a type.

Expected behavious

It just works, by fallbacking from application/x-sh to txt/plain, or by never inferring application/x-sh in the first case (I not aware of the use case of this mime type).

Workaround

wl-paste | cat > hello.sh

See also

I also saw this post referring to the same problem: https://www.reddit.com/r/linux4noobs/comments/1azwfjj/how_does_shell_outputinput_redirect_work_it_seems/

Rodrigodd avatar Oct 02 '24 23:10 Rodrigodd

Hi!

wl-paste | cat > hello.sh

rather, try: wl-paste --type text > hello.sh

bugaevc avatar Oct 03 '24 10:10 bugaevc