Timeline for Almost working smoothly attempt to get terminal Emacs to copy to clipboard
Current License: CC BY-SA 4.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 24, 2019 at 8:19 | history | edited | user1404316 | CC BY-SA 4.0 | Code modification: Improve checking of $DISPLAY to handle ssh cases |
| Oct 23, 2019 at 10:07 | comment | added | user1404316 | @ishmael: Thanks. How about (if (not (string-match ":" x-display)) to avoid the cl library? | |
| Oct 18, 2019 at 0:10 | comment | added | ishmael | This is an excellent solution to a very old problem! One small suggestion: I would change (if (not (string= (substring x-display 0 1) ":")) to (if (not (cl-search ":" x-display)) because when you SSH, the DISPLAY variable contains more than just a two numbers separated by a colon. Instead, it's something like "localhost:46.0". This way, the function will work across an SSH connection, as long as you enabled X-forwarding using "ssh -X" or "ssh -Y". | |
| Mar 26, 2019 at 9:08 | comment | added | Craig Hicks | The situation is that my system Ubuntu 18.04 is operating with a Gnome-on-Wayland window system. Part of that system includes a psuedo-X interface, necessary for back compatibility. That psuedo-X interface has a single seat :0, which is guaranteed to be always present. Therefore the code will work on Ubuntu 18.04 with Wayland as is - but as your correctly state it is not safe for use with honest X systems. | |
| Mar 11, 2019 at 21:51 | history | edited | user1404316 | CC BY-SA 4.0 | Edit code to handle $DISPLAY in tmux for emacsclient |
| Mar 7, 2019 at 22:27 | comment | added | user1404316 | @CraigHicks: Don't know what to tell you. That would be a separate question for someone else to answer. | |
| Mar 7, 2019 at 22:08 | comment | added | Craig Hicks | Interestingly, on my desktop Ubuntu 18.04 linux system, there is also nothing corresponding to /tmp/X*. I see processes: /usr/bin/Xwayland and /usr/lib/xorg/Xorg running. | |
| Mar 7, 2019 at 21:56 | comment | added | user1404316 | @CraigHicks: That's the point. Those /tmp files should exist If and only if an X-server is running. Thus, if your emacs is -nw, ie. `(not display-graphic-p), but there is an X-server, and thus an X-clipboard, find the x-display id and send the data to that display's x-clipboard. This may mess up in cases of multiple users accounts operating multiple workstations ("seats" in X11 terminology) on the host machine; maybe it needs to additionally test for matching UID's for the x-display | |
| Mar 7, 2019 at 21:36 | comment | added | Craig Hicks | I am now looking at the /tmp directory of a remote Ubuntu 16.04 sever not running X, and there is nothing for /tmp/X*. This part of your answer I don't understand. | |
| Mar 7, 2019 at 21:29 | comment | added | Craig Hicks | Very helpful, thanks. Using xsel turned out to be the key, and there is a story behind that. | |
| Mar 7, 2019 at 21:04 | vote | accept | Craig Hicks | ||
| Mar 7, 2019 at 19:22 | history | edited | user1404316 | CC BY-SA 4.0 | deleted 14 characters in body |
| Mar 7, 2019 at 19:12 | history | edited | user1404316 | CC BY-SA 4.0 | code optimize |
| Mar 7, 2019 at 19:02 | history | answered | user1404316 | CC BY-SA 4.0 |