Skip to content
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

Wrapping pbcopy causes hang on MacOS Sierra 10.12 #60

Open
fatmcgav opened this issue Feb 24, 2017 · 3 comments
Open

Wrapping pbcopy causes hang on MacOS Sierra 10.12 #60

fatmcgav opened this issue Feb 24, 2017 · 3 comments

Comments

@fatmcgav
Copy link

Observed whilst attempting to use Python Openstack client.

It would appear that installing the reattach-to-user-namespace bottle with the --with-wrap-pbcopy-and-pbpaste causes the Openstack client to hang.

An example of the stack trace is here, with the relevant line highlighted.
Running pbcopy -help on the CLI also results in a hang.

Running the system pbcopy directly works.
E.g.:

/usr/bin/pbcopy -help
2017-02-24 14:58:32.265 pbcopy[12486:7664884] Usage: pbcopy [-help]

Thoughts?

@ChrisJohnsen
Copy link
Owner

I think this is a problematic interaction between the Homebred-supplied pbcopy script and your use of command-line arguments.

Based on this, it looks like Homebrew’s wrapped pbcopy does not pass command line arguments to the actual pbcopy (it also has a useless-use-of-cat). So when you run this wrapper script as pbcopy -help it ignores your -help, and ends up just waiting to read something on its stdin (it is actually the useless cat doing the reading/blocking here, but pbcopy would behave identically given that it would not have been given a command line argument that would cause its immediate exit).

If you arrange for its stdin to be /dev/null (or a pipe that is closed from the opposite end, et cetera), then it will return quickly (although it will also clobber the pasteboard with an empty string). Arguably though, Homebrew should probably fix those pbcopy and pbpaste scripts to pass along arguments (and drop the useless cat, which would still trip up your pbcopy -help use case unless you provide an empty stdin).

@fatmcgav
Copy link
Author

@ChrisJohnsen Yeh, that aligns with my tests whereby not wrapping the pbcopy/pbpaste commands fixes the hang.

Are you responsible for the Homebrew formula, or should I bug it separately over there?

Cheers

@ChrisJohnsen
Copy link
Owner

I do not use Homebrew; I am not sure how best to get it changed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants