going back through output that has scrolled off screen with scroll mode, searching text in long buffers, editing scrollback in your favorite editor, and managing the clipboard across OSes via copy_command.

One of the most common complaints about a plain terminal: output that has scrolled past the screen is gone without a trace. A build fails with the error already scrolled above the screen, a crash log loads thousands of lines, and you can only see the last ten. In episode 5 we learned to manage space; in this episode we learn to manage time — going back through each pane's history via scrollback, searching for one pattern in the middle of thousands of lines, even opening scrollback content directly in an editor.
Scrollback is Zellij's "memory". Every pane stores a number of output lines in a buffer (default 10000 lines per pane, changeable via the scroll_buffer_size option). What's visible on screen is only a small window into that buffer. Scroll mode gives you full control over that window: smooth line-by-line scrolling, page jumps, shooting to the top or bottom, searching text with various search options, and even editing scrollback in $EDITOR for long-form analysis.
Why does this skill matter? In debugging, context is everything. The error confusing you has often appeared dozens of lines above — and hunting with your eyes is the slowest possible way. Master scroll, search, and copy mode, and you turn the terminal from a typing tool into an investigation tool. In this episode we also close the last loop of the workflow: getting text out of Zellij into the clipboard or a file, across operating systems.
Beyond reading, this episode finishes one more thing: getting results out. Copying an error to a team chat, saving a log to attach to a ticket, sending output snippets to documentation — all of that needs a reliable exit path. Zellij provides automatic mouse selection copy, plus the copy_command option that makes the clipboard work on any platform, from macOS to a GUI-less Linux server. After this episode, there's no more excuse for retyping output that's already on screen.
Scroll mode is accessed with Ctrl+s. Like every other mode, once entered, the status bar changes to show all available actions. You can immediately start navigating with the keys below the screen — no memorization needed, the hints are always there.
| Keybind | Action |
|---|---|
Ctrl+s | Enter Scroll mode on the focused pane |
Ctrl+s (again) / Esc / Enter | Return to Normal mode |
Ctrl+c | Jump straight to the bottom line and return to Normal |
It's important to understand: scrollback is per pane. Scroll mode works on the pane currently in focus, not the entire tab. This is a sound design decision — you usually want to browse the output of one process, not a mix of many. Move to another pane, enter Scroll mode again, and you browse that pane's buffer.
While in Scroll mode, your position is marked. If you press a navigation key and nothing happens, chances are you're already at the same end of the buffer — nothing's wrong, there's simply nothing left to scroll. Ctrl+c always returns you to the very bottom with a single press, and exits the mode at the same time.
Scrollback can also be cleared. In many shells, clear only wipes the screen — old lines stay alive in the buffer. Zellij provides zellij action clear which deletes the focused pane's entire buffer (or a pane specified with --pane-id). Use it when you start a long new experiment and want to begin with clean context, without closing a pane that's still useful.
Scrollback navigation follows a pattern familiar from the Vim editor — this isn't a coincidence. Zellij adopts idioms many developers already know so you don't have to learn from scratch.
| Keybind | Action |
|---|---|
j / ↓ | Scroll down one line |
k / ↑ | Scroll up one line |
Ctrl+f / PageDown | Scroll down one page |
Ctrl+b / PageUp | Scroll up one page |
d | Scroll down half a page |
u | Scroll up half a page |
g | Jump to the very top line of the scrollback |
G | Jump to the very bottom line |
Distinguish these two groups of keys clearly. j/k are micro movements — one line per press, for reading slowly or heading to a specific line. Ctrl+f/Ctrl+b are macro movements — one full screen per press, for racing through thousands of log lines. Between them sit d/u for half pages, a comfortable compromise for medium-length files.
1. Ctrl+s enter scroll mode
2. g jump to the start of the buffer
3. Ctrl+f scan forward quickly, one screen
4. k ease back as you approach the target
5. Ctrl+c return to the bottom and exit the modeThe combination of g then repeated Ctrl+f is the fastest way through a build log tens of thousands of lines long. As you approach the area you're looking for, slow down with k. This small habit feels slow at first, but after a day of work your hands move automatically.
There's one more way that's often overlooked: the mouse. With mouse_mode enabled (the default), you can scroll scrollback directly with the mouse wheel inside a pane — Zellij handles the scrolling behind the scenes without switching modes. And here's an interesting detail: while holding Ctrl, the mouse wheel resizes panes (controlled by the mouse_scroll_resize option, enabled by default). This combination means some people never touch Ctrl+s for light work, saving Scroll mode for serious navigation.
Manual scrolling still loses to long logs. This is where Search mode steps in. From Scroll mode, press s — the status bar turns into a search input box. Type a pattern, press Enter, and Zellij jumps to the matching line while highlighting every occurrence.
| Keybind | Action |
|---|---|
Ctrl+s then s | Enter the search input |
Enter | Confirm the search, enter Search mode |
n | Jump to the next occurrence |
p | Jump to the previous occurrence |
c | Toggle case sensitivity (case-sensitive / insensitive) |
w | Toggle wrap around (continue the search from the start) |
o | Toggle whole word (only whole words) |
Esc | Exit Search mode back to Scroll mode |
The three toggles are Zellij search's hidden power. c (case) decides whether error is the same as Error. w (wrap) decides whether the search continues from the top of the buffer when it reaches the end — useful if the last occurrence is above. o (whole word) keeps err from matching words like errant. Toggle states show in the status bar, so you always know the current search condition.
A detail about the input flow: when you press s, you enter the search input mode (EnterSearch). Esc or Ctrl+c cancels and returns to Scroll mode; Enter confirms and takes you to Search mode with all occurrences highlighted. Separate these two steps in your mind: typing the keyword is step one, pressing Enter is step two that "locks in" the search. After that, n and p become the main keys — and Esc returns you to Scroll mode without clearing the search results.
Tip
Zellij's search is live against all buffer lines, no matter how far those lines are from the screen. To find the first line where an error appeared, don't scroll — go straight to Ctrl+s then s, type error, and press n until you reach the topmost plausible occurrence. This turns debugging from "reading forward" into "smart jumping".
One note: search is a plain literal string, not regex. If you need complex patterns, copy the scrollback to an editor and use the editor's regex — which brings us to the next section.
Sometimes scrollback is too complex to analyze on screen: you want regex, you want to save the result as a file, or you want to share a log with the team. From Scroll mode, press e — Zellij opens the entire scrollback content of the focused pane in your editor ($EDITOR or $VISUAL, overridable via the scrollback_editor option).
export EDITOR=nvim
zellij action edit-scrollbackOnce the editor opens, the scrollback is treated as a plain text file: you can edit, save, write to another file with :w /tmp/log.txt, or copy the parts you want. This feature is more useful than it sounds — instead of copying a hundred lines manually, you can filter with grep or regex in the editor and keep only the relevant lines.
Buffer size also plays a role here: e opens the entire scrollback according to scroll_buffer_size. If you raise that option to hundreds of thousands of lines, opening the editor can take time and memory. Zellij offers a way out: zellij action dump-screen --full copies the viewport or the entire scrollback to stdout or a file (--path), which you can process without any interactive editor — for example piped into grep or saved as an artifact. This flexibility matters when the buffer you're facing is very large.
Important
Make sure $EDITOR or $VISUAL is set in your environment before relying on e. Otherwise Zellij fails to open an editor and you get an error message. Set it once in your shell config (export EDITOR=nvim for example), and everything in the terminal — including Zellij — uses the same editor.
Why does this feature matter practically? Imagine a production incident: the full log is in the scrollback, and you need to analyze and report. With e, the entire context is available as a file — save it, attach it to a ticket, or process it with a script. This is the bridge between the fast-moving terminal and the well-organized documentation.
The last part of this episode is getting text out of Zellij. By default (copy_on_select), just select text with the mouse and the selection is automatically copied to the clipboard — called copy-on-select. You can also move focus and scroll with the mouse to extend the selection. This is the fastest way to copy an error snippet or a command.
If you disable copy_on_select, there's a manual Alt+c keybind that can be enabled to copy a selection. And equally important: where does the text get copied? Zellij sends it via OSC 52 — a terminal protocol that directs the terminal emulator's clipboard. But not every terminal and environment supports OSC 52 (especially SSH into certain servers). The solution: the copy_command option, which runs a command and pipes the text into its stdin.
copy_command "wl-copy"Because the three commands above are platform-specific, this is a perfect example of the code-group pattern:
pbcopyPick the one matching your system and put it as a single copy_command "..." line in config.kdl. Pasting still uses your terminal's paste (Ctrl+Shift+v in most terminals, or middle click for primary selection on Linux). Note: the full config.kdl setup is covered in episode 8 — for now, just drop in this option if you're having copy-paste problems.
There's one more option worth knowing: copy_clipboard. By default Zellij copies to the system clipboard (system), but on X11/Wayland you can choose primary — the lightweight middle-click buffer for quick pastes without touching key combos. One important note from the config's default comments: this option does not apply when copy_command is used, because that command takes over the entire clipboard flow. Understand these two layers — OSC 52/terminal, then copy_command — and copy-paste problems are almost always solved.
Warning
The difference in clipboard systems: on X11, xclip -selection clipboard copies to the system clipboard, while xclip with no arguments copies to the primary selection (the middle-click buffer). Wayland uses wl-copy; macOS uses pbcopy. Choosing the wrong copy_command makes text appear "not copied" when it was actually copied somewhere you didn't check. Test the command in a plain shell first.
Finally, let's discuss pasting. Zellij has no built-in paste keybind because it delegates pasting to the terminal emulator: Ctrl+Shift+v in most terminals, or middle click for the primary selection on X11. For automation from outside a session, there's zellij action paste "text" which writes text to a pane in bracketed paste mode — a safe way because the text isn't interpreted as keypresses. And for those who disable copy-on-select: enable the bind "Alt c" { Copy; } line in the scroll mode of the default config, so selections are copied explicitly and the clipboard isn't overwritten by accidental selections.
Ctrl+s scrolls the focused pane, not the whole tab. Other panes' process output isn't included — move to the pane first before browsing.$EDITOR. e (edit scrollback) silently fails when $EDITOR is empty. Set it once in your shell config, or set scrollback_editor in the Zellij config.error with case-sensitivity on skips Error at the start of a sentence. Get used to pressing c to toggle until the status bar shows the mode you want.copy_command across OSes. Copying pbcopy from a macOS tutorial onto Linux will fail. Always match the platform: pbcopy (macOS), wl-copy (Wayland), xclip (X11).10000 lines. Output past that limit is discarded FIFO — for processes with giant logs, raise scroll_buffer_size in the config (covered in episode 8) before you start.You now have the tools to investigate every pane's past: smooth and fast scrolling with Vim idioms, searching with case/wrap/whole-word toggles, editing scrollback directly in your favorite editor, and exporting text to a cross-platform clipboard. This turns the terminal from a place to type into a place to think — when an error appears, you no longer panic-scroll manually, but go straight to Ctrl+s, search, edit, copy.
Key takeaways:
Ctrl+s then j/k, Ctrl+f/b, d/u, g/G.Ctrl+s then s, browse with n/p, adjust c/w/o.e opens the entire buffer in $EDITOR.copy_command for the clipboard via pbcopy/wl-copy/xclip.In episode 7 next, we move up a visual level: floating panes and pane frames. You'll learn to create panes floating above the layout (Ctrl+p then w or Alt+f), pin a floating pane, convert a regular pane to floating and back, stack several floating panes, and play with layout swapping and fullscreen. See you in episode 7.