Alexander Zeitler

Alexander Zeitler

Selecting and copying text without border in Zellij using the keyboard

Published on Saturday, September 28, 2024

Photo by Michelle Ding on Unsplash

Keyboard

Thanks to Omakub I got introduced to Zellij:

Zellij is a terminal workspace. It has the base functionality of a terminal multiplexer (similar to tmux or `screen) but includes many built-in features that would allow users to extend it and create their own personalized environment.

This is how a Zellij window could look like, showing the output from /var/log/syslog

syslog output in Zellij

Now we want to copy this part (in the last line of the output) using the keyboard only:

2024-09-28T06:56:13.403642+02:00 aetron kernel: [UFW BLOCK] IN=enp14s0

First press CTRL+SHIFT+SPACE to enable the vim mode in Zellij.

Then navigate to the first char you want to copy using the cursor key:

Cursor at first char to be selected

Now press v to enable vim Visual Mode (nothing will change visually).

Now move the cursor to the right until the char you want to be copied last.

Zellij Visual Mode selection

Finally, press y and this will yank you selection and it will be available in your clipboard for further usage.

Great, but there's one issue: multiline selection:

Zellij multiline selection includes the border

As you can see, the green border is included in the selection and this will mess up you copied content.

But there's a solution for that:

Press CTRL+p, then z to disable the border before you're entering vim Mode:

Zellij without border

Now you can copy multiple lines without including the border.

If you want to get the border back, press CTRL+p, then z again.

Instead of using Visual Mode, you can also enable Visual Line Mode by hitting V instead of v and that will allow you to just select full lines by moving the cursor up and down.

What are your thoughts about "Selecting and copying text without border in Zellij using the keyboard"?
Drop me a line - I'm looking forward to your feedback! email
Imprint | Privacy