Add X clipboard support layer to terminal emacs.
The X clipboard allows a user to copy and paste content between different X
windows, e.g. copying text from Chrome into a Terminal. Copy/pasting with the X
clipboard it well supported in GUI Emacs, but not so well in terminal Emacs
(i.e `emacs -nw` or `emacsclient -t`) without resorting to using the mouse,
since terminal Emacs has no awareness of X. There are several incomplete Elisp
solutions out that work for the most part, but may not have cross-platform
support, or may fail over SSH with X forwarding or within a `tmux` session.
This layer adds support for OSX, Linux, Windows, and Cygwin using the relevant
binary on each system. For example on Linux, it uses `xsel` or `xclip` to
interface with the clipboard, depending which one is available. It also adds
support for ssh'ing into a different OS with X forwarding via `ssh -Y hostname`,
and copy/pasting to and from a remote terminal Emacs. It also supports an edge
case of continuing to work in an Emacs instance running inside a `tmux` session
which may have been started by a different ssh session, which relies on
explicitly reseting the `$DISPLAY` environment variable before calling the
relevant binary.
Yank code inspired by https://github.com/tmux-plugins/tmux-yank.
Fix #4662.
Tried to add xclip support but removed it since it freezes.
2017-05-08 03:08:52 +00:00
|
|
|
#+TITLE: xclipboard layer
|
|
|
|
|
2018-09-19 03:54:47 +00:00
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
2018-05-11 04:19:21 +00:00
|
|
|
- [[#description][Description]]
|
2018-05-19 16:43:48 +00:00
|
|
|
- [[#features][Features:]]
|
2018-12-05 03:03:03 +00:00
|
|
|
- [[#key-bindings][Key bindings]]
|
Add X clipboard support layer to terminal emacs.
The X clipboard allows a user to copy and paste content between different X
windows, e.g. copying text from Chrome into a Terminal. Copy/pasting with the X
clipboard it well supported in GUI Emacs, but not so well in terminal Emacs
(i.e `emacs -nw` or `emacsclient -t`) without resorting to using the mouse,
since terminal Emacs has no awareness of X. There are several incomplete Elisp
solutions out that work for the most part, but may not have cross-platform
support, or may fail over SSH with X forwarding or within a `tmux` session.
This layer adds support for OSX, Linux, Windows, and Cygwin using the relevant
binary on each system. For example on Linux, it uses `xsel` or `xclip` to
interface with the clipboard, depending which one is available. It also adds
support for ssh'ing into a different OS with X forwarding via `ssh -Y hostname`,
and copy/pasting to and from a remote terminal Emacs. It also supports an edge
case of continuing to work in an Emacs instance running inside a `tmux` session
which may have been started by a different ssh session, which relies on
explicitly reseting the `$DISPLAY` environment variable before calling the
relevant binary.
Yank code inspired by https://github.com/tmux-plugins/tmux-yank.
Fix #4662.
Tried to add xclip support but removed it since it freezes.
2017-05-08 03:08:52 +00:00
|
|
|
|
|
|
|
* Description
|
2018-05-19 16:43:48 +00:00
|
|
|
=xclipboard= integration layer.
|
|
|
|
|
2018-11-21 15:30:54 +00:00
|
|
|
** Requirements
|
|
|
|
|
|
|
|
This layer depends on a few platform-specific command-line tools:
|
|
|
|
|
|
|
|
- on OSX, this layer calls =pbcopy=
|
|
|
|
- on Windows, this layer calls =clip.exe=
|
|
|
|
- on GNU/Linux systems, this layer relies on =xsel= to be available.
|
|
|
|
|
|
|
|
Note that =xsel= might not be installed by default on e.g. Ubuntu systems.
|
|
|
|
|
2018-05-19 16:43:48 +00:00
|
|
|
** Features:
|
2018-09-19 03:54:47 +00:00
|
|
|
- adds copy support to the X-clipboard from the terminal.
|
|
|
|
- adds paste support to the X-clipboard from the terminal.
|
Add X clipboard support layer to terminal emacs.
The X clipboard allows a user to copy and paste content between different X
windows, e.g. copying text from Chrome into a Terminal. Copy/pasting with the X
clipboard it well supported in GUI Emacs, but not so well in terminal Emacs
(i.e `emacs -nw` or `emacsclient -t`) without resorting to using the mouse,
since terminal Emacs has no awareness of X. There are several incomplete Elisp
solutions out that work for the most part, but may not have cross-platform
support, or may fail over SSH with X forwarding or within a `tmux` session.
This layer adds support for OSX, Linux, Windows, and Cygwin using the relevant
binary on each system. For example on Linux, it uses `xsel` or `xclip` to
interface with the clipboard, depending which one is available. It also adds
support for ssh'ing into a different OS with X forwarding via `ssh -Y hostname`,
and copy/pasting to and from a remote terminal Emacs. It also supports an edge
case of continuing to work in an Emacs instance running inside a `tmux` session
which may have been started by a different ssh session, which relies on
explicitly reseting the `$DISPLAY` environment variable before calling the
relevant binary.
Yank code inspired by https://github.com/tmux-plugins/tmux-yank.
Fix #4662.
Tried to add xclip support but removed it since it freezes.
2017-05-08 03:08:52 +00:00
|
|
|
|
2018-12-05 03:03:03 +00:00
|
|
|
* Key bindings
|
Add X clipboard support layer to terminal emacs.
The X clipboard allows a user to copy and paste content between different X
windows, e.g. copying text from Chrome into a Terminal. Copy/pasting with the X
clipboard it well supported in GUI Emacs, but not so well in terminal Emacs
(i.e `emacs -nw` or `emacsclient -t`) without resorting to using the mouse,
since terminal Emacs has no awareness of X. There are several incomplete Elisp
solutions out that work for the most part, but may not have cross-platform
support, or may fail over SSH with X forwarding or within a `tmux` session.
This layer adds support for OSX, Linux, Windows, and Cygwin using the relevant
binary on each system. For example on Linux, it uses `xsel` or `xclip` to
interface with the clipboard, depending which one is available. It also adds
support for ssh'ing into a different OS with X forwarding via `ssh -Y hostname`,
and copy/pasting to and from a remote terminal Emacs. It also supports an edge
case of continuing to work in an Emacs instance running inside a `tmux` session
which may have been started by a different ssh session, which relies on
explicitly reseting the `$DISPLAY` environment variable before calling the
relevant binary.
Yank code inspired by https://github.com/tmux-plugins/tmux-yank.
Fix #4662.
Tried to add xclip support but removed it since it freezes.
2017-05-08 03:08:52 +00:00
|
|
|
|
2018-12-05 03:03:03 +00:00
|
|
|
| Key binding | Description |
|
Add X clipboard support layer to terminal emacs.
The X clipboard allows a user to copy and paste content between different X
windows, e.g. copying text from Chrome into a Terminal. Copy/pasting with the X
clipboard it well supported in GUI Emacs, but not so well in terminal Emacs
(i.e `emacs -nw` or `emacsclient -t`) without resorting to using the mouse,
since terminal Emacs has no awareness of X. There are several incomplete Elisp
solutions out that work for the most part, but may not have cross-platform
support, or may fail over SSH with X forwarding or within a `tmux` session.
This layer adds support for OSX, Linux, Windows, and Cygwin using the relevant
binary on each system. For example on Linux, it uses `xsel` or `xclip` to
interface with the clipboard, depending which one is available. It also adds
support for ssh'ing into a different OS with X forwarding via `ssh -Y hostname`,
and copy/pasting to and from a remote terminal Emacs. It also supports an edge
case of continuing to work in an Emacs instance running inside a `tmux` session
which may have been started by a different ssh session, which relies on
explicitly reseting the `$DISPLAY` environment variable before calling the
relevant binary.
Yank code inspired by https://github.com/tmux-plugins/tmux-yank.
Fix #4662.
Tried to add xclip support but removed it since it freezes.
2017-05-08 03:08:52 +00:00
|
|
|
|-------------+---------------------------------------------|
|
|
|
|
| ~SPC x p~ | Paste clipboard contents at cursor position |
|
2018-05-11 04:19:21 +00:00
|
|
|
| ~SPC x y~ | Copy selection to clipboard |
|