Skip to content

History suggestions

As you type a command in a terminal, ZestSSH looks in your command history for the newest command that starts with what you have typed so far, and draws the rest of it dimmed after the cursor. Press Right arrow to take it. Until you do, nothing of it is sent to the server.

History suggestions work on phones and computers.

Suggestions come from your command history, so three things must be on:

  • Squeezed. Command history is a Squeezed feature (see pricing).
  • Command history recording. It is off until you turn it on, on each device. Open History (on a computer, in the side bar under Utilities; on a phone, More > History) and choose Turn on where it says “Recording is off. New commands are not saved.”
  • Suggest as you type (Right arrow takes it). On at first. It is in the History page’s menu.
  1. Type the start of a command, at least two characters, for example sudo sys.
  2. If your history has a command that starts exactly so, for example sudo systemctl restart nginx, the rest of it appears dimmed after the cursor.
  3. Press Right arrow to take it. On a phone, use → on the keys row above the keyboard.
  4. Press Enter to run it, as with anything you type.

Taking a suggestion types the rest of the command for you; it does not run it. Any other key hides the suggestion, and typing on looks again with what you have typed then. Right arrow with no suggestion on screen moves the cursor as usual.

  • Your own history, in the same space. A session of a host in your personal space suggests from your personal space’s history; a session of a team’s host suggests from that team’s history, never from your personal space’s.
  • The newest command that starts with exactly what you typed. Capital letters count: Sudo does not match sudo.
  • This host first. A command you ran on the host in front of you comes before one you ran elsewhere.
  • Commands of one line. A command of several lines is never suggested. The suggestion is drawn on the cursor’s row, up to the edge of the terminal; Right arrow types all of it, also a part that did not fit.

Since 3.2, when your history has nothing that fits, the suggestion also comes from:

  • A path on the host. While the last word you type is a path starting with / or ~/, ZestSSH lists that folder on the host over the session’s own connection (SFTP) and suggests the rest of the name: a folder’s with / after it, or what several names share. Names starting with . appear once you type the dot. A path relative to the shell’s folder is not suggested, since ZestSSH does not know that folder. A listing is kept for a few seconds; a host that offers no SFTP is not asked again in that session.
  • A saved host after ssh . Typing ssh 192.168.10 suggests a saved host as the command reaches it, alex@192.168.10.21 with -p and its port when it is not 22, the hosts you connected to last first.
  • A snippet. A saved snippet whose command starts with what you typed; snippets that ask for values ({{name}}) are left out.

A suggestion appears only where ZestSSH can tell what you typed and see it on the screen:

  • At a password prompt: the prompt shows nothing of what you type, so nothing matches.
  • In a program that fills the screen, such as vim, less or top.
  • After arrow keys, a command recalled from the shell’s own history, or a paste the shell marks as one (bracketed paste), until you press Enter, Ctrl+C or Ctrl+U: ZestSSH cannot follow what such a line holds.
  • When the screen shows something else than what you typed, for example after Tab completed a word.
  • In tmux control mode (tmux windows shown as ZestSSH tabs), and in a terminal that only receives a broadcast.
  • While Recording mode is on, so a recording never shows what you ran before.

A suggestion adds nothing to what ZestSSH stores. It is drawn on the screen only: it is not part of the terminal’s text, it is never in the scrollback, and nothing of it reaches the server until you take it.

The suggestions come from the command history, which keeps:

  • each command you ran, the host it ran on and when,
  • its exit status, how long it ran and the folder it ran in, where the shell reports them; these stay on the device.

The command history leaves out:

  • passwords typed at a prompt that hides them, always,
  • commands that look like they carry a secret, such as mysql -psecret or export TOKEN=.... While recording is on, the History page’s menu has Save secret-bearing commands to keep them too. With it on, the page says “Also saving commands that may contain secrets.”

If you use sync, the command history goes with the rest of your data to your other devices, end-to-end encrypted. The exit status, how long a command ran and its folder do not sync.

History in the side bar shows the commands you ran in terminals as one table, grouped by day, newest first. Its columns are Host, Command (with how many times it ran in a row), Folder, Result (ok or exit 1), Took and Time. Folder, result and run time come from the host’s shell integration (OSC 133 and OSC 7, sent by tools such as starship), so they stay empty for a host whose shell sends none.

The filters are on one row above the table: Search commands, a host picker (All hosts), Hide trivial and Failed only. With Hide trivial on, commands such as cd, ls and clear are folded into a line for each day that names them, with Show. How history works explains what is saved and what is not; the newest 2,000 commands are kept.

Point at a row for Run again, Copy and Save as snippet. Run again opens a menu: Run on web-01 (the host it ran on) or Run on… to pick another host. The command runs exactly as you typed it: a ${...} or $[...] in it goes to the shell as written, and ZestSSH asks no snippet questions. Dangerous command protection still checks it. On a host with no open session, ZestSSH opens one and runs the command once it is connected.

Click a row to see when it started and its full folder, with Delete, Save as snippet and Run again on web-01.

  1. Open History (on a phone, More > History).
  2. Open the page’s menu (on a computer, More actions; on a phone, the … at the top).
  3. Untick Suggest as you type (Right arrow takes it).

This is a setting of this device. It turns suggestions off and keeps your history. To stop recording new commands as well: on a computer, choose Recording on in the same menu, which switches it to Recording off; on a phone, tap the record button at the top of History.

  • One command: on a phone, tap the trash icon (Delete) on the command. On a computer, click the command’s row and choose Delete.
  • All of it: open the History page’s menu, choose Clear all, then confirm (Clear command history: “Delete all recorded commands? This also removes them from your other devices on the next sync.”).

A deleted command is no longer suggested.

  • Snippets for commands you run often enough to save by name.
  • Recording mode for screenshots and screen sharing without your history on screen.