Scrollback
Scrollback is the output that has scrolled off the top of a tab. You can scroll back to it, search it (Ctrl+Shift+F) and copy from it.
How much is kept
Each tab keeps the last 5,000 rows. Older rows are dropped as new ones arrive. A long line that wraps over three rows counts as three.
Why 5,000
It is more than 100 screens of a 46-row window, which covers the output of a long command, at a cost of about 8 MB a tab. Twenty tabs come to about 160 MB, which leaves a 16 GB laptop comfortable.
The cost comes from how the terminal stores text: 12 bytes for every column of every row, whether or not the row is full. A tab 132 columns wide therefore spends about 1.6 KiB on each row.
| Rows kept | One tab, 132 columns wide | Twenty tabs |
|---|---|---|
| 5,000 (today) | 8 MB | 160 MB |
| 10,000 | 16 MB | 320 MB |
| 50,000 | 79 MB | 1.6 GB |
A wider tab costs more in proportion: 200 columns is half as much again.
Scrollback is not a record
Scrollback lives in memory and goes when the tab closes. To keep future terminal output on disk, start a session log or tagged session log before the commands you want to keep.
Changing it
Not yet: the number is fixed. Planned, with the session settings:
- A setting for each session, inherited like the others (all sessions, then the folder, then the session), from the default up to 50,000 rows.
- A limit of 1 GiB on scrollback across all open tabs together, because the per-tab limit alone would let twenty full tabs take 1.6 GB. A new tab that would pass it gets what is left, never less than the default, and says so.
- Clear scrollback, and Save scrollback to a file.
Limits
- The memory figures are arithmetic from the terminal library's storage (12 bytes a cell, version 6.0.0). They have not been measured in the running app yet; that is done when the setting is built.
Where it lives in the code
ui/app.js,SCROLLBACK_LINES.