Skip to content

Use the lab terminal

The terminal is where you do the work in a Klastro lab. It runs in your browser and connects to a real environment, so there is nothing to install. This page shows how to use it day to day.

Before you start: open a lab and wait until the terminal stops showing Your environment is being prepared. See The lab workspace for the layout.

The terminal pane can hold two kinds of terminal tab.

Tab When it appears Where it puts you
Shell 1, Shell 2… Always The session shell. kubectl, helm and this lab’s credentials are set up here.
Node, or Node 1, Node 2… Only when your lab has machines A terminal directly on that machine. One tab per machine, up to five.

In a lab with machines, the terminal opens on Node 1, and hovering a Shell tab reminds you that the session shell is not one of the machines.

  1. Click the + button (New shell) at the end of the tab strip. A new Shell tab opens and becomes active.

  2. Switch between tabs by clicking them. Every tab keeps running while hidden, so a long command in Shell 1 carries on while you work in Shell 2.

  3. To close a shell, hover its tab and click the × that appears.

You can have up to five Shell tabs open at once. The + button disappears when you reach the limit. The last remaining Shell tab cannot be closed, and Node tabs cannot be closed.

When your lab has machines, the Instructions pane has a Connect to the machines section (collapsed by default). It lists one copy button per machine, for example ssh node1, ssh node2.

  1. Expand Connect to the machines in the Instructions pane.

  2. Click the command for the machine you want. It is copied to your clipboard.

  3. Paste it into a Shell tab and press Enter.

To run a single command on a machine without opening a session there, use the same form with the command in quotes, as shown in that section: ssh node1 'kubectl get nodes'.

The terminal uses your browser’s normal copy and paste. Klastro does not ask for permission to read your clipboard.

To Do this
Copy text from the terminal Select it with the mouse, then press Cmd+C
Paste into the terminal Cmd+V
Interrupt the running command Ctrl+C

If your shell shows a green status line at the bottom, it runs inside tmux, which is what keeps it alive across reloads. In that case, scroll back through earlier output with tmux’s own scroll mode:

  1. Press Ctrl+B, release, then press [.

  2. Move with the arrow keys or Page Up / Page Down.

  3. Press q to return to the prompt.

Your shells run in the lab, not in your browser. Closing the tab, reloading the page or losing your network does not stop them: commands keep running, and when the terminal reconnects you find the same shell with its output. Klastro also remembers which tabs you had open, in that browser tab, and reopens them after a reload.

The terminal does not reconnect on its own after its connection drops. When it does, a bar appears at the bottom of the terminal reading Terminal disconnected or Terminal connection error, and the tab’s dot turns grey or red.

  1. Click Reconnect in that bar.

  2. If the terminal still does not come back, reload the page. Your shells are still running and reattach as the tabs reopen.

Two other signs tell you the lab itself is waiting rather than the terminal:

  • A Wi-Fi-off icon at the right of the tab strip, and Waiting to start session… in the status bar: the page has lost its live link to your lab. It reconnects automatically.
  • Reconnecting… in the middle of the terminal pane, before any shell has appeared: the same thing, seen before the terminal first connects.

If a terminal will not reconnect at all, see Terminal troubleshooting.

Situation Running commands
You switch to another tab in the lab Keep running
You reload the page or your connection drops Keep running; the terminal reattaches to them
You close a Shell tab with × Klastro stops showing it. Do not rely on finding it again: finish or stop long-running commands before closing their tab.
You pause the lab (Pause & resume later) Your files and environment are kept. Check, after resuming, that any foreground command you need is still running, and start it again if not.
You end the lab, or it ends Everything stops and the environment is destroyed