Choose and delete buffers in buffer mode
host=db-1.internal is pasted at the prompt and buffer stale is deleted.
C-b ] only ever pastes the newest buffer. Buffer mode is how you reach any of the others:
C-b =- open it; every buffer, newest first, with a preview
Up/Down- move
Enterorp- paste the selected buffer
d- delete it
q- leave
Two kinds of buffer sit in that list. Automatic buffers are the ones copy mode makes — buffer0, buffer1 — and the oldest drops off past 50. A named buffer, made with set-buffer -b name, never ages out, so a stale one stays in your list until you delete it by hand.
Press C-b =.
The newest buffer, host=web-3.internal, is at the top.
Press Down to select host=db-1.internal, then Enter.
It appears at the shell prompt, not run.
Press C-b = again, move to stale, press d, then q.
It vanishes from the list.
The buffer-mode keys
Buffer mode uses the same keys as tree mode: t tags, and D deletes the tagged buffers the way X kills tagged windows there.
Here is what just happened.
C-b = runs choose-buffer. Enter runs paste-buffer on the selected buffer instead of the newest; d runs delete-buffer on it. That is the only way a named buffer leaves the list, since it never ages out.
- Enter buffer mode: Enter or p pastes the selected buffer, d deletes it, q exitsC-bthen=
- Delete the selected buffer without pasting itd
Go further
set-buffer -b name -n newnamerenames a buffer from the prompt.show-buffer -b nameprints a buffer’s whole contents.save-bufferandload-buffermove buffers to and from files.
- 1
C-b ]only ever pastes the newest buffer. Buffer mode,C-b =, lets you pick any. - 2Newest is at the top.
Downonce selectshost=db-1.internal; Enter pastes it. - 3Reopen with
C-b =, move tostale, pressdto delete it,qto leave. Pasted the wrong thing?C-uclears the shell line.
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 older host=db-1.internal buffer was pasted into the shell pane— not done yet
- No buffer named stale remains on the server— not done yet