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

clipboard(x) blocks indefinitely (maybe just on Linux?) #14510

Closed
ghost opened this issue Dec 30, 2015 · 3 comments
Closed

clipboard(x) blocks indefinitely (maybe just on Linux?) #14510

ghost opened this issue Dec 30, 2015 · 3 comments
Labels
REPL Julia's REPL (Read Eval Print Loop)

Comments

@ghost
Copy link

ghost commented Dec 30, 2015

julia> clipboard("Help, I'm trapped inside the computer!")
Waiting for selection requests, Control-C to quit
  Waiting for selection request number 1

Here Julia is waiting on xclip, which runs until another program intercedes to reset the clipboard. It would be more convenient -- for me, at least -- if xclip and xsel could detach themselves and run in the background. That way, we could carry on with our program in the meantime. It would only take an option change to fix:

--- base/interactiveutil.jl
+++ base/interactiveutil.jl
@@ -108,8 +108,8 @@
     end
     function clipboard(x)
         c = clipboardcmd()
-        cmd = c == :xsel  ? `xsel --nodetach --input --clipboard` :
-              c == :xclip ? `xclip -quiet -in -selection clipboard` :
+        cmd = c == :xsel  ? `xsel --input --clipboard` :
+              c == :xclip ? `xclip -silent -in -selection clipboard` :
             error("unexpected clipboard command: $c")
         open(pipeline(cmd, stderr=STDERR), "w") do io
             print(io, x)

(Compare–contrast the clipboard() method, where running in the foreground is natural; xsel and xclip return as soon as they've retrieved its contents.)

@ihnorton ihnorton added the REPL Julia's REPL (Read Eval Print Loop) label Jan 2, 2016
vtjnash added a commit that referenced this issue Apr 5, 2016
clipboard: update parameters of `xclip`

ref #14510
@Jollywatt
Copy link
Contributor

This is still an issue for me today: clipboard(x) hangs because of the --nodetach option for xsel. If I remove the --nodetach option, this works. Should we remove --nodetach?

Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = subl

@vtjnash
Copy link
Member

vtjnash commented Mar 20, 2020

Yes, apparently someone made a PR to fix xclip, but nobody has yet made a PR to fix xsel.

@JeffBezanson
Copy link
Member

fixed by #35180.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

4 participants