Selection and the mouse
The mouse does two jobs in a terminal: selecting text for you, and clicking for the program
running inside it. Termina gives it to the program when the program asks, and Shift always takes
it back.
Selecting
- Drag to select. The cell under the pointer is included once the pointer passes its middle, and the highlight is exactly what copying will give you.
- Double-click selects a word, triple-click a line.
- Select All (
Ctrl+Shift+A,Cmd+Aon macOS) selects the scrollback and the screen. - A plain click clears the selection, and so does typing.
A selection stays on its text as output arrives, even once the scrollback is full, so what you selected a moment ago is still what gets copied. A line the terminal wrapped is copied as one line, without a line break in the middle.
Not there yet: dragging past the top or bottom edge does not scroll, there is no rectangular selection, and selecting does not copy by itself.
Copy and paste
| Key | Does |
|---|---|
Ctrl+Shift+C (Cmd+C) | Copy the selection |
Ctrl+Shift+V (Cmd+V) | Paste the clipboard |
Ctrl+Insert | Copy |
Shift+Insert | Paste |
| Middle-click | Paste the clipboard |
Ctrl+Shift+K (Cmd+K) | Clear Scrollback, keeping the screen |
Plain Ctrl+C is still SIGINT and plain Ctrl+V is still readline’s literal-next; both belong to
the shell.
Pasting is checked first
- A paste with a line break asks first. At a prompt every line of a paste runs the moment it lands, which is how a copied snippet with a stray newline becomes a command you did not mean to run. The prompt shows the text that will be sent, with Paste as the default button. Settings → Terminal → Input → Ask before pasting several lines turns it off.
- Control characters are stripped. Escape and the other control characters are removed before the paste is sent, keeping tabs and line breaks. A clipboard cannot end a bracketed paste early and have the rest run as typing.
- Bracketed paste is used whenever the shell has turned it on.
Mouse reporting
When a program turns on mouse reporting, clicks, drags and the wheel go to it before anything local happens: vim moves its cursor, htop responds to clicks, and a program that asks for every pointer movement gets it. JediTerm encodes the events in whichever of the four xterm wire formats the program chose.
Hold Shift to bypass it. Shift+drag selects text inside a program that has the mouse, which
is the only way to copy anything out of htop. That is the xterm convention.
Right-click
Right-click is wanted by both sides: you want it for Copy and Paste, and a mouse-aware program such as Midnight Commander wants it as a button. The rule:
- With no program holding the mouse, right-click opens the menu.
- While a program holds the mouse, right-click goes to the program.
Shift+right-click always opens the menu.- The keyboard’s menu key always opens the menu.
Escape, a click anywhere in the terminal, or a click outside the window closes it.
The wheel and scrollback
- The wheel scrolls the scrollback by distance, so a trackpad’s many small events do not fling it past. Typing returns to the live screen.
- On the alternate screen a full-screen program owns the view and there is no scrollback
behind it. The wheel turns into arrow keys there, so
lessandmanscroll with it even though they never turn on mouse reporting. - From the keyboard:
Shift+PageUpandShift+PageDownmove a page,Shift+HomeandShift+Endgo to the top and the bottom. On the alternate screen these go to the program instead.
Settings → Appearance → Window → Show a scrollbar (on by default) adds a bar that shows and drags the scrollback. It takes a column of its own rather than covering the last one, and hides on the alternate screen. Settings → Terminal → Session → Scrollback lines sets how much history is kept, from the next tab on.
Middle-click
Middle-click pastes the clipboard, not the X11 primary selection. JavaFX has no access to the
primary selection, and selecting text in Termina does not fill it. Like any click, it goes to the
program when the program has the mouse, unless Shift is held.
The right-click menu
- Open Link and Copy Link Address, when you right-click a URL or a file path. See Links.
- New Tab, New Window
- Copy, Paste (disabled when there is nothing to copy or paste), Select All
- Clear Scrollback
- Zoom: the row of
−, the percentage,+and full screen. See Zoom. - Show Menu Bar, a checkbox, on Linux and Windows. It is how the menu bar comes back once hidden.
- Settings…