Each SSH session opens in a tab. Above it, the route bar shows how the session gets to the host and gives you its files, your snippets and split panes.
Opening sessions
- Click a host in the sidebar to connect. Hosts with an open session show a status square in the sidebar.
- Open as many tabs as you like, also several to the same host.
- Use Quick connect (the plus at the end of the tab bar) for a host you haven't saved.
Tabs of hosts that use the Production terminal scheme get a red marker and a PROD label, and tabs that are being recorded get a REC marker. See Themes and terminal appearance and Session logs.
Each terminal keeps the last 10,000 lines of output to scroll back through. MorphGate has no keyboard shortcuts of its own: every key you press goes to the session.
The route bar
Above each session, the route bar shows:
- the VPN, if one carries the connection, and its address once connected;
- each jump host on the way;
- the host and the address you're signed in as;
- the pinned host key's type and a short fingerprint, or certified by and a host CA's name when a host CA you trust signed the host's certificate (see SSH keys and host keys);
- Recording, when the session is recorded;
- Files, which opens the host in the SFTP browser;
- Broadcast, in a tab split into panes;
- Split, which opens another session in the same tab;
- Snippets, which pastes or runs a saved command.
Split panes
A tab can show several sessions at once, side by side or one below the other.
- In the route bar, choose Split.
- Pick Side by side or Below.
- Choose the current host (This host again, a new session), or type in Another host… and pick one.
- Each pane is a session of its own, with its own connection. Click into a pane to type there.
- Drag the border between two panes to resize them.
- Close a pane with the × in its header. When one pane is left, it becomes a normal tab again.
- The tab bar shows a split as one tab, with + and the number of other panes. Its × closes every pane.
Broadcast sends what you type in one pane to every other connected pane of the tab, for example to run the same command on several servers. While it's on, the button says Broadcasting to and the number of panes, and each pane is marked BROADCAST. Snippets from the route bar's Snippets menu then go to every pane too. Choose the button again to type into one pane only.
Snippets
A snippet is a command, or several lines of commands, you keep in the vault.
- Choose Snippets in the sidebar to open the Snippets page, then New snippet: a Name, the Commands and optional Tags. The route bar's Snippets menu also has New snippet….
- The Snippets page shows each snippet's name, the first line of its commands and its tags. Search them, or show only those with one of your most used tags. A snippet's name opens it.
- In a session, open Snippets in the route bar. Choose a snippet to paste it, or Run to paste it and press Enter.
- On the Snippets page, and on a snippet's own page, Paste and Run send it to the last terminal tab you used, if it's still connected. Otherwise the snippet's page says Open a connected terminal tab to paste or run this snippet.
- To add many at once, choose Import… on the Snippets page and pick a CSV file whose first line names the columns: Name, Command and Tags. Download an example saves one to start from. A snippet the vault already has by that name starts unticked; tick it to replace the saved one.
- A team's feed can bring snippets too. They're read-only: Make a copy to change one. When the feed has changed one since you last ran it on this device, Run and Paste ask first. See Snippets from a feed.
MorphGate pastes with bracketed paste where the remote shell supports it, so a multi-line snippet doesn't run line by line as you paste it.
When a connection drops
If a connection is lost, MorphGate says Connection lost and tries again by itself, after 2, 5, 15 and 30 seconds. If your computer is offline, it waits until the network is back. Retry now skips the wait. A connection that goes silent, for example when the network disappears without a word, is noticed within about a minute and a half.
When a session ends any other way, because the remote shell exited or the connection never opened, the tab shows Reconnect. Each reconnect is a new session in the same tab, and what was on the screen stays.
If you typed a password for a host that has none saved, MorphGate uses it again for these reconnects until you close the tab. It is never saved in the vault.
Keep the session on the server
With Keep the session on the server (tmux) on in a host's editor, or Keep sessions on the server (tmux) in its group, each tab attaches to its own tmux session on the host, and creates it if it's missing. A dropped connection, a restart of MorphGate, or the same host opened on another device then picks up where you were.
- The first tab to a host uses the tmux session
morphgate, the nextmorphgate-2, and so on. Your first tab on another device attaches to the samemorphgatesession, so you see the same screen on both. - Closing a tab only detaches from tmux. The session and whatever runs in it keep going on the server, and the next tab to that host attaches to it again. To end it, exit the shell inside tmux.
- A host with a Login command (optional) runs that command instead, so the tmux setting is off for it.
The host needs tmux installed. Where it isn't, you get a normal shell.
Locking closes sessions
Locking the vault, by hand or after the idle time you set, closes every terminal, file browser, tunnel and VPN. With tmux kept on the server, your work there keeps running and you can attach again. See Unlocking and auto-lock.
On a phone or a narrow window
On a phone or tablet, and in a window as narrow as a phone, MorphGate uses a phone layout: hosts with open sessions on top, a sheet per host with its route, and a full-screen terminal with a row of keys a phone keyboard lacks: Esc, Tab, Ctrl, the arrows, |, ~ and /. Ctrl applies to the next key you type. In a session, More has Files, Snippets and Disconnect.
MorphGate picks the layout while no session is open. With sessions open, it keeps the layout it has, since switching would reopen every session. The phone layout has no split panes.