Scroll, search the scrollback and paste
The request id from the buried ERROR line is pasted into the right pane.
Lines that scroll off the top of a pane are not gone — they go into its scrollback, and copy mode is how you read them.
C-Up/C-Down- scroll the history one line, the cursor staying put
PageUp/PageDown- a screen at a time
C-r- search backward as you type
C-b ]- paste the newest buffer into the active pane
Search backward, not forward: from the bottom of the history, everything you want is above the cursor. C-r is incremental — the cursor jumps to the nearest match above on every keystroke, Enter stops there, C-g cancels and returns you.
The counter at the top right of copy mode shows how far up you are.
Press C-b [, then hold C-Up until the counter passes 50.
You are 50 lines up in the history.
Press C-r, type ERROR, Enter.
The cursor lands on ERROR request-id=req-51c2e9a7d4 failed.
Press C-a, C-Space, C-e, then M-w.
The line is copied and copy mode ends.
Press C-b o, type echo with a trailing space, press C-b ], then Enter.
The line prints in the right pane.
Repeating a search
n and N repeat the last search, forward and backward. How many scrollback lines a pane keeps is the history-limit option.
Here is what just happened.
C-Up and C-r are scroll-up and search-backward-incremental, sent with send-keys -X. C-b ] runs paste-buffer, which types the newest buffer into the active pane as if you had typed it, so it landed after echo .
- Scroll the history without moving the cursor line by lineC-Up
- Search backwards through the history as you type; Enter stops at the match, C-g cancelsC-r
- Paste the most recent buffer into the active paneC-bthen]
Go further
M-fandM-bmove by word, to select justreq-51c2e9a7d4instead of the line.history-limitsets how many scrollback lines a pane keeps.
- 1Search backward, not forward: from the bottom of the history everything is above the cursor.
- 2
C-b [, then holdC-Upuntil the counter passes 50.C-r, typeERROR, Enter jumps to the line. - 3On the line:
C-a,C-Space,C-e,M-w. ThenC-b o, typeecho,C-b ], Enter.
This is a live terminal. Typing goes to the machine, including Tab. Press Shift and Tab together to move focus back out to the page.
A real terminal, in this tab
Alpine Linux and tmux 3.4 on an x86 emulator. Nothing to install, and no server behind it.
about 15 MB, once
Done when
not started- The left pane is in copy mode, scrolled at least 50 lines up from the bottom— not done yet
- A paste buffer contains the request id from the ERROR line— not done yet
- The request id was pasted into the shell in the right pane— not done yet