zellij
zellij copied to clipboard
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
- Open ZelliJ
- Select a text with the mouse
- Notice, that there is a 'Text copied to system clipboard' displayed on the bottom
- 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)
I had the same issue with wezterm, I configured wezterm to allow pasting to and from wezterm to system clipboard. Now it works fine I can copy to and from system clipboard to wezterm and vice versa. I think the issue is not with zellij, it is with the terminal emulator. As per my knowledge these terminal emulators don't have default config for copy and paste except bash.
I've just run into this and I'm at a loss as to what changed on my end to trigger it. I switched machines and use Arch so there's a lot.
What may provide some indication as to what is going wrong is that I can manage to get text copied by Zellij to come out. Just not in a terminal or gVim. Both Chrome and Firefox via Ctrl-V will gladly paste whatever Zellij copies. xclip cannot find this text in any of the 3 selection buffers so I'm lost as to where it's getting stashed. Using xclip in copy_command will also work, but my standard usage has zero X forwarding between my box and where I'm running Zellij.
Please fix this, the workflow without proper copy-paste is hellish.
X.Org 1.21.1.11 zellij 0.39.2 kitty 0.33.0 xfce4-terminal 1.1.3 (4.18) Chrome 122.0.6261.128 Firefox 124.0
Circling back around, reading #1288 helped figure out the fix. I do want to call out that sometimes under very unpredictable circumstances copy/paste in Zellij does work with my current pre-fixed environment. It definitely involves both mouse and Zellij pane focus but I haven't gotten a consistent recipe.
Now on to my fix -- autocutsel -selection PRIMARY syncs things such that mouse select inside Zellij can then paste wherever via middle click. This only changes the behavior of copy/paste while running Zellij. xfce4-terminal and kitty both do fine without it when not running Zellij.
Same happens to me in Konsole terminal. Works fine in alacritty
Inside fish shell copy with mouse not working
Even not with keystrokes
Wayland kde plasma im using.
Keystrokes not working, i tryed every config 3 options wl-copy too
same like @osevan void linux kde plasma yakuake copy is not working from zellij
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
@marawanxmamdouh thank you for the tip.
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!
@joaotux if you're using wayland why are you using xclip instead of wl-copy?
@eric-hansen wl-copy doesn't work for me.
Wl-copy didn't work for me either in fedora
Thanks for the alternative @joaotux
using xclip did it for me copy_command "xclip -selection clipboard" // x11
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"
Had same issue when using zellij via ssh in Tabby terminal, and only setting mouse_mode to false in .config/zellij/config.kdl resolved it, unfortunately killing the mouse scroll functionality. If anyone has a better solution, please let me know.
fixing this on osx should definitely be more obvious upon initial setup.
I installed Zellij today for the first time on macOS Sequoia in Terminal.app and although it says it copied the text to the system clipboard, it didn't. iTerm2 and Ghostty worked fine.
For those who would like to keep mouse_mode to true, you can press shift while selecting text. This allows the terminal to handle the selection instead of Zellij.
mouse_mode true
copy_command "xclip -selection clipboard" // x11
Working through an ssh connection with Tabby.
For those who would like to keep
mouse_modetotrue, you can pressshiftwhile selecting text. This allows the terminal to handle the selection instead of Zellij.mouse_mode true copy_command "xclip -selection clipboard" // x11Working through an ssh connection with Tabby.
The copying part of this works for me (using Ubuntu and zellij inside standard gnome-terminal), but I cannot past with middle-click on the mouse in the zellij session (and that works in all other applications, even with text copied into clipboard by zellij).
So, to paste anything back into zellij, I have to shift+mark and then SHIFT+CTRL+V to paste (if I've set zellij up to copy to system clipboard). I would like to be able to paste by middle-click (from primary clipboard instead), as I can do - also with the text copied by zellij - into any other window.
I'm on Debian 13 and I only use xterm. When I added this to my .Xresources:
XTerm*allowWindowOps: true
then changed copy_clipboard "primary" in $HOME/.config/zellij/config.kdl and now I have proper copy-and-paste support. Leaving this here in case it helps someone else.