Copy (xclip backend) hangs when called in side shell command substitution
See original GitHub issueHello,
OS: Debian unstable linux-amd64
Pyperclip 1.6.0
Backend in use: xclip
Shell: zsh, dash
pyperclip.copy() hangs when called inside shell’s command substitution. When xclip executes, python process is gone while xclip stays up running. But it seems to be Python3-ony problem, Python2 is fine.
$ python3 --version
Python 3.6.4
$ echo "$(python3 -c 'import pyperclip; pyperclip.copy("foo")'; echo "foo")"
<hangs> ...
$ pgrep python
$ pgrep xclip
5659
Python 2.7.14+
$ echo "$(python2 -c 'import pyperclip; pyperclip.copy("foo")'; echo "foo")"
foo
$
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
xclip hangs shell-command - Emacs Stack Exchange
xclip has to "hang" around to own the clipboard, as X uses asynchronous clipboards which belong to a process. You should be able...
Read more >Highest scored 'xclip' questions - Stack Overflow
Python script using subprocess and xclip hangs if piped in bash ... Byobu with screen backend: Connect copy buffer to system clipboard.
Read more >My 10 Linux and UNIX Command Line Mistakes - nixCraft
My top 10 Linux / Unix command line mistakes that cause some sort of downtime on my server/cluster. Try to avoid them. Learn...
Read more >Mastering Eshell - Mastering Emacs
Eshell is a shell written entirely in Emacs Lisp, and it replicates most of the features and commands from GNU CoreUtils and the...
Read more >Command Line Options - Valve Developer Community
Linux shell scripts pointing to the application with launch options. executable -command. Examples. steam.exe -applaunch 280 -dev -console -sw +sv_lan 1 + ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Well, it seems that
xclipis kind of broken in general when used in pipes. E.g. this one hangs as well:Could you make
xselpreferred overxclip?Installing
xselsolves my headache. Maybe make it an explicit dependency better?