Skip to content

Local shell

ZestSSH can open a shell on the device itself, with no server: your computer’s own shell, or Android’s.

Platform Status Shell
Android Full support /system/bin/sh
iOS Not available (iOS does not let apps start other programs)
Windows Full support Windows PowerShell, or Command Prompt where PowerShell is missing
macOS Full support Your login shell ($SHELL), else zsh
Linux Full support Your login shell ($SHELL), else bash
  • On a computer: on the Hosts page, choose Local terminal (“Open a terminal on this computer”).
  • On Android: on the Hosts tab, tap the terminal icon (Local terminal) in the bar at the top. A large tablet with the computer’s layout has Local terminal on its Hosts page, as a computer does.

Each one opens a new shell. Nothing is saved.

From 4.0, a snippet can run in a new local shell. On a computer, and on an Android tablet that shows the computer’s layout, a snippet’s Run on… lists Local terminal (“A new terminal on this device”) first. ZestSSH asks for the snippet’s variables and its questions, then opens the shell and enters the snippet once it is ready. See In a terminal on this device.

  1. Add a host and choose Local under Protocol. There is no key to pick. From 4.2 a local host has no address and no port: it has what it runs, see A host that runs a program.
  2. Leave Program empty for the system’s own shell, and choose Save host, then connect to it like any host.

A phone offers Local on Android only.

From 4.2 a saved local host can start any program on the device, not only the system’s shell: another shell, a WSL distribution, or a console program such as a REPL or a tool of your own. In the host’s form, where other hosts have their address:

Field What it is
Program A name the device finds, like cmd, bash, pwsh or python, or a full path. Empty is the system’s own shell. Under the field, On this device: lists the shells ZestSSH found; tap one to fill it in.
Arguments As on a command line. Put quotes around one that has a space. With Program empty they go to the system’s shell.
Start in A folder on the device. Empty is your home folder. ~ at the start stands for it.
Runs on Windows, macOS, Linux, Android. Tick the systems the host is for; with none ticked it is for any.

The host’s Environment variables go into the environment of what starts, the system’s own shell included, and from 4.3 they are never typed into it. A Startup command (optional) and a Run snippet (optional) are typed into whatever started, once the device has agreed to them (see below).

On the Hosts page the host shows what it runs in place of an address.

Examples:

  • PowerShell 7 in a project folder: Program pwsh, Arguments -NoLogo, Start in C:\work\project.
  • A WSL distribution: Program wsl, Arguments -d Ubuntu.
  • A Python tool in its virtual environment: Program the environment’s own Python (C:\work\tool\.venv\Scripts\python.exe, or ~/tool/.venv/bin/python), Arguments app.py, Start in the tool’s folder. Nothing has to be activated: that Python uses its environment.
  • A full path is used as it is.
  • A bare name is looked for in the folders of the PATH, in their order. On Windows the endings of PATHEXT (.exe and the others) are tried. A name that already ends in one of them is used as it is; any other dot is part of the name, so python3.12 is looked for as python3.12.exe.
  • On Windows a batch file (.bat or .cmd) is not started: Windows would read its arguments again as commands. The host says so (ZS-1012). Leave Program empty and run the batch file in the shell, or name cmd as the program with /c and the batch file as its arguments.
  • ZestSSH never looks in the current folder, and a path that starts from the current folder (.\tool.exe) is refused. So a program planted where ZestSSH happened to be started cannot run in place of the one you meant.

A host that runs a program is a way to run code, and hosts travel: by sync, a restore, an import. So before a local host’s program, arguments or folder runs on a device for the first time, ZestSSH asks Run this program on this device? and shows what would run. From 4.3 the question covers all a local host runs: its program, arguments, folder, variables, startup command and the snippet it runs on connect (the snippet by its text). It shows each variable with its value, the startup command and the snippet, every character visible, and it asks again if any of them was changed on another device since. A local host with any of these therefore asks once on each device after the update to 4.3. What is typed is what was agreed to. A plain local shell, with none of them, asks nothing.

Making the host in its form on a device, or changing what it runs there and saving, counts as agreeing there, so the device you set it up on does not ask. A rename alone agrees to nothing. What a device agreed to stays on that device and is not synced, and deleting the host forgets it. An automation that opens such a host with nobody there stops instead of asking.

  • A host ticked for other systems does not start elsewhere: “This host runs a program for Windows. It does not start on this device (macOS).” (ZS-1011)
  • A program that is not on the device: “pwsh was not found on this device. Check the name in the host’s settings, or give its full path.” (ZS-1009)
  • A folder that is not on the device: “The folder to start in does not exist on this device” (ZS-1010)
  • On an iPhone or iPad a local host says that iOS lets no app start a program, and that it opens on a computer or an Android device. (ZS-1011)

The shell runs behind a real pseudo-terminal, so line editing, Tab completion, Ctrl+C, job control, colours, resizing and full-screen programs (vi, top, less) work as in any terminal.

  • Windows: ZestSSH starts powershell.exe from the Windows folder by its full path, without its banner (-NoLogo), in your user folder. Without PowerShell it starts Command Prompt. The shell keeps your environment.
  • macOS and Linux: ZestSSH starts your login shell as an interactive login shell (-il), in your home folder, so your profile and aliases load. The shell keeps your environment.
  • Android: ZestSSH starts /system/bin/sh in the app’s own folder, with a UTF-8 locale, TERM=xterm-256color, a short prompt, and /system/bin and /system/xbin on the PATH.

Every shell gets TERM=xterm-256color.

The shell runs as you, with your permissions. On Android it runs with the app’s permissions: it can reach the app’s own folder and the commands in /system/bin (such as ls, cat, ping, ip and the toybox tools), and nothing of other apps.

  • Network checks: ping, traceroute, ip addr from the device itself.
  • A quick command without leaving ZestSSH, next to your SSH sessions.
  • Trying a one-liner locally before running it on a server.
  • Not on iPhone or iPad. A local host synced there says so when opened (ZS-1011).
  • No SFTP and no tmux control mode: both go over SSH, so a local shell does not offer them. In a tab with an SSH session and a local shell side by side, the buttons act on the SSH session and their tooltip names it.
  • Never a team’s host. A local shell is for your own space. A host in a team’s vault saved as a local shell does not open, however it got there: “This team host is saved as a local shell, and a team’s host never opens a shell on this device. Nothing was started and nothing ran.” (ZS-1406) Its row says “Blocked: a team host cannot open a shell here”.
  • Counts as a session: on the free plan a local shell counts toward the session limit (5 on a computer, 3 on a phone). At the limit, ZestSSH says “Free tier session limit reached - upgrade to Squeezed for unlimited.”
  • Android’s shell is small: only what Android ships in /system/bin. There is no package manager; for apt, python and the like, install a terminal environment such as Termux.
  • No root on Android, unless the device is rooted.

ZestSSH is an SSH client only. It does not run an SSH server (sshd) on any platform, so other devices cannot SSH into your phone or computer through ZestSSH, and the local shell is not reachable over the network.

To reach something on your device from elsewhere:

  • A remote forward makes a port on your device reachable from a server you are connected to, through that SSH connection, while the session is open. See Remote forwards.
  • For an SSH server on Android, install an app that provides one (for example Termux with its openssh package), then connect to it with ZestSSH like any other host.
  • Press Enter.
  • On an older Android device the shell may take a moment to start.

Android’s shell has few tools. Try toybox before the command (toybox whoami), or list what there is with ls /system/bin.

Q: Is this the same as Termux? A: No. On Android it is the system’s own small shell. Termux is a full Linux environment with packages.

Q: Can a local host run something other than a shell? A: Yes, from 4.2: set Program in the host’s form. See A host that runs a program.

Q: Which shell opens on my computer? A: Windows PowerShell on Windows, and your login shell on macOS and Linux.