astrand / xclip

Command line interface to the X11 clipboard
GNU General Public License v2.0
1.03k stars 73 forks source link

False read from a previous write and segmentation fault on a second read #113

Open changkun opened 3 years ago

changkun commented 3 years ago

Version: 11cba613840b0d0e76dc2ea6d4ec7cc5f23daf88

$ echo test > x.txt
$ cat x.txt
test
$ cat x.txt | xclip -in -selection clipboard
$ xclip -out -selection clipboard -t image/png
test
$ xclip -out -selection clipboard -t image/png
[1]    619206 segmentation fault (core dumped)  xclip -out -selection clipboard -t image/png

Version 0.13:

$ echo test > x.txt
$ cat x.txt
test
$ cat x.txt | xclip -in -selection clipboard
$ xclip -out -selection clipboard -t image/png
test
$ xclip -out -selection clipboard -t image/png
test

Explaination:

The -t option does not work with -in when specifying inputs. An input by default as text but can be read as image/png TARGET.

Expect:

$ echo test > x.txt
$ cat x.txt
test
$ cat x.txt | xclip -in -selection clipboard
$ xclip -out -selection clipboard -t image/png
Error: target image/png not available
$ xclip -out -selection clipboard -t image/png
Error: target image/png not available