zellij: Copying text to the system clipboard doesnt work

2. Issues with the Zellij UI / behavior

Issue description

Unable to copy text selection / url from Zellij doesn’t work - even though zellij reports, that ‘Text copied to system clipboard’. However, I can’t paste the text / url. I’ve tried to run Zellij in KDE’s Konsole, xterm, and wezterm, and it behaves exactly the same

Minimal reproduction

  1. Open ZelliJ
  2. Select a text with the mouse
  3. Notice, that there is a ‘Text copied to system clipboard’ displayed on the bottom
  4. Neither middle button click, nor the other ‘paste’ keyboard shortcuts could trigger paste

Other relevant information

zellij 0.39.2

konsole 21.12.3 wezterm 20230712-072601-f4abf8fd XTerm(372)

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 13
  • Comments: 18

Most upvoted comments

same with gnome-terminal default ubuntu terminal

to fix it you can follow this

Some terminals don’t support the the OSC 52 signal, which is the method Zellij uses by default to copy text to the clipboard. To get around this, you can either switch to a supported terminal (eg. Alacritty or xterm) or configure Zellij to use an external utility when copy pasting (eg. xclip, wl-copy or pbcopy).

To do the latter, add one of the following to your Zellij Config:

copy_command: "xclip -selection clipboard" # x11
copy_command: "wl-copy"                    # wayland
copy_command: "pbcopy"                     # osx

Note that the only method that works when connecting to a remote Zellij session (eg. through SSH) is OSC 52. If you require this functionality, please consider using a terminal that supports it.

then make sure to kill all zellij sessions and restart your terminal

Ubuntu 24.04 with wayland.

Install xclip sudo apt install xclip

Add in config.kdl copy_command “xclip -selection clipboard”

Kill session zellij zellij delete-all-sessions

Everthing working!

This changes work for me (copy and paste)

Install xclip if it’s not already installed: sudo apt install xclip

Navigate to this file cat .config/zellij/config.kdl

Uncomment the following line copy_command "xclip -selection clipboard"

@marawanxmamdouh thank you for the tip.

Same happens to me in Konsole terminal. Works fine in alacritty

fixing this on osx should definitely be more obvious upon initial setup.

using xclip did it for me copy_command “xclip -selection clipboard” // x11

Wl-copy didn’t work for me either in fedora

Thanks for the alternative @joaotux