Doom-emacs: TTY emacs does not paste text from the system clipboard.

Created on 2 Jul 2020  Â·  4Comments  Â·  Source: hlissner/doom-emacs

What did you expect to happen?
For TTY emacs to paste the text copied from the system clipboard.

What actually happened?
TTY emacs did not paste the text copied from the system clipboard. The text does not even show up when evil-show-registers is called.

On the other hand, GUI emacs does not have this problem. In fact, copy-pasting to GUI emacs saves the text to the registers to allow TTY emacs to use it also.

Additional details:

  • Used vanilla doom.

Steps to reproduce:

  1. Run emacsclient -t
  2. Copy text from system clipboard
  3. Paste via p in emacs

System information:


((emacs
(version . "28.0.50")
(features . "XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP")
(build . "Jun 14, 2020")
(buildopts "--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-sound=alsa --with-modules --without-gconf --without-gsettings --with-x-toolkit=gtk3 --without-xaw3d --without-compress-install 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -flto' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now")
(windowsys . batch)
(daemonp . server-running))
(doom
(version . "2.0.9")
(build . "HEAD -> develop 46d6d0b58 2020-06-29 15:12:30 -0400")
(dir . "~/.doom.d/"))
(system
(type . gnu/linux)
(config . "x86_64-pc-linux-gnu")
(shell . "/bin/bash")
(uname . "Linux 4.14.183-1-MANJARO #1 SMP PREEMPT Wed Jun 3 22:24:53 UTC 2020 x86_64")
(path "~/.emacs.d/bin" "~/.cargo/bin" "~/bin" "~/.local/bin" "/usr/local/bin" "/usr/bin" "/bin" "/usr/local/sbin" "/usr/lib/jvm/default/bin" "/usr/bin/site_perl" "/usr/bin/vendor_perl" "/usr/bin/core_perl" "~/.gem/ruby/2.7.0/bin" "/usr/lib/emacs/28.0.50/x86_64-pc-linux-gnu"))
(config
(envfile . envvar-file)
(elc-files . 0)
(modules :completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline ophints (popup +defaults) vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold snippets :emacs dired electric ibuffer undo vc :checkers syntax :tools (eval +overlay) lookup magit :lang data emacs-lisp ledger markdown (org +dragndrop +hugo +pandoc +pomodoro +present +roam) sh :config (default +bindings +smartparens))
(packages (header2) (om :recipe (:host github :repo "ndwarshuis/om.el")) (calfw) (calfw-org) (org-edna) (org-protocol-capture-html :recipe (:host github :repo "alphapapa/org-protocol-capture-html")) (org-web-tools) (org-roam-server) (md-roam :recipe (:host github :repo "nobiot/md-roam")) (notdeft :recipe (:host github :repo "hasu/notdeft")))
(unpin "n/a")
(elpa "n/a")))

:os tty bug retty resolved

Most helpful comment

As of 0a4841b Doom has a :os tty module, which provides clipboard integration in the terminal (through xclip by default, or clipetty if enabled with the +osc module). Check out its documentation wrt terminal support.

With that, I'll consider this resolved. Let me know if the module doesn't work for you and I'll reopen the issue. Thanks for bringing it to my attention!

All 4 comments

Emacs doesn't handle clipboard in TTY.

You can add xclip-mode to your configuration to do that. Doom ships with https://github.com/spudlyo/clipetty but it requires support from a terminal emulator.

I'm using kitty which is supposedly compatible with clipetty, but it doesn't seem to work. Although, xclip-mode worked so thanks.

I remember this has been discussed at multiple places as a security concern - allowing TTY application to read system clipboard.
I also use kitty and I use kitty's own paste keybinding kitty_mod + v and works just fine.

As of 0a4841b Doom has a :os tty module, which provides clipboard integration in the terminal (through xclip by default, or clipetty if enabled with the +osc module). Check out its documentation wrt terminal support.

With that, I'll consider this resolved. Let me know if the module doesn't work for you and I'll reopen the issue. Thanks for bringing it to my attention!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idoo picture idoo  Â·  3Comments

rgrinberg picture rgrinberg  Â·  3Comments

Ptival picture Ptival  Â·  3Comments

benjaminbauer picture benjaminbauer  Â·  3Comments

gilbertw1 picture gilbertw1  Â·  3Comments