HARBOR USER GUIDE

Blocks mode

See every command as a card with its output, exit code and duration, type in a smart composer, and review what edits changed.

Blocks mode

In Blocks mode, each command you run is shown as a card (a block) with its folder, start time, duration, exit status and output. You write commands in a composer at the bottom instead of typing into the terminal. Full-screen programs like vim, less and htop still get a normal terminal.

New sessions open in Blocks mode by default. Switch between Blocks and Classic in the session header; Settings › Terminal › New sessions open in sets the default.

Requirements

Blocks mode works on servers whose login shell is bash or zsh. Hosts with another shell, a tmux session, or network devices stay in Classic and show “Blocks unavailable on this host, using Classic.” Harbor remembers that for the host; choose Blocks again to retry.

Reading a block

  • ✓ 0 in green means the command succeeded; ✗ and the exit code in red means it failed. Commands you stop with Ctrl+C show a grey Stopped.
  • A block shows 15 lines of output (the newest while it runs). Show N more lines expands it, and very long output opens in Open full output, a viewer that handles millions of lines.
  • Identical lines in a row collapse into one with a ×N badge.
  • Output wraps to fit the card instead of scrolling sideways.
  • Hover a block to copy the command, copy the output, run it again, or save it as a snippet.
  • When a command fails and suggests installing something (apt install …, pip install …, npm install …), the suggestion becomes a button that runs it for you, with guardrails applied.

The composer

  • Enter runs the command; Shift+Enter adds a new line.
  • Tab completes command names and paths from the server.
  • Up and Down recall earlier commands. Suggestions and a faded autofill come from the server’s own ~/.bash_history or ~/.zsh_history and the commands you ran in Harbor; press → to accept the autofill.
  • Commands you run are remembered per host. Anything that looks like a password, token or key is masked before it’s saved.

While a command runs

The composer becomes the command’s input: password prompts, y/n questions and Ctrl+C work as in a terminal, and what you type there isn’t saved to history. Stop interrupts the command.

Production guardrails

On Production hosts, guardrails check each command before it’s sent. A command that needs confirming appears as an orange block with Cancel and Run on production.

Full-screen programs and pagers

Programs that take over the screen (vim, nano, less, top, htop) get the real terminal until they exit. Blocks then returns with a block such as “vim nginx.conf · exited 0”.

To keep output in blocks, Harbor sets PAGER, GIT_PAGER, SYSTEMD_PAGER and MANPAGER to cat for the session (and clears AWS_PAGER). If a pager still opens (for example under sudo), the terminal is shown until the command ends.

What an edit changed

When you open files with vi, vim, nvim, nano, micro, emacs or sudoedit from the composer (with or without sudo, up to three files), Harbor copies them first. When the editor exits, the block shows a diff of what changed, with context.

  • Values of settings that look like passwords, secrets, tokens or keys are shown as ••••••, so a diff reads DB_PASS=•••••• secret value changed without revealing either value.
  • Revert puts the file back as it was, after asking. It refuses if the file changed again since. Files only root can write are reverted with sudo tee in your session, so sudo asks for your password and guardrails apply.
  • Save backup saves the earlier version to your computer.

The copies are kept in Harbor’s memory only (up to 1 MB per file) and are dropped when the session closes. Files your login user can’t read (such as sudo vi /etc/shadow) show Not compared.

How it works, and what it changes on the server

After you log in, Harbor sends a short setup line to that session’s shell. It adds hooks that mark where each prompt, command and output starts. It writes no files on the server, and it’s gone when you disconnect. Tab completion and history use separate, invisible SSH channels.

Known limits

  • Only bash and zsh.
  • Prompts that rebuild themselves on every command (starship, powerlevel10k) may hide some markers. Blocks still work, and commands come from the composer.
  • In bash, the session’s DEBUG trap is replaced, which can clash with bash-preexec.
  • In zsh without HIST_IGNORE_SPACE, the setup line can stay in that session’s in-memory history.
  • A new shell inside the session (su, sudo -i, exec bash, ssh to another server) has no integration until you choose Blocks again.
  • Output that moves the cursor around (other than full-screen programs) is shown approximately.
  • Edit diffs follow editors started from the composer only.