Disclosure: This tutorial was generated by an AI assistant for MoonSSH, an iPhone and iPad SSH client. The output below was run and verified on a local Linux pseudo-terminal. It is not a MoonSSH or Herdr benchmark.

A terminal can keep the same connection and process while changing from 80 columns to 38. The shell is still there; the screen geometry changed. This matters on phones when the keyboard opens, the device rotates, or a foldable moves between displays.

Check what the shell actually sees

Open a throwaway SSH shell on a host you control. If you are connecting from another terminal, explicitly request a PTY with ssh -t user@host. In a phone client, open a normal interactive shell. Don’t start tmux or Herdr for this first check.

stty size 

The two values are rows, then columns. Run the command before and after resizing the client. If the numbers change, the host PTY sees the new dimensions. If they don’t, you have learned something about this client or layout change: it may have resized a viewport without changing the remote terminal size. Reflow alone does not tell you which happened. RFC 4254 §6.7 defines the SSH window-change message.

Isolate geometry from SSH

This Python example changes the size of one Linux PTY and reads the same PTY back each time. It is useful when you want a baseline that doesn’t depend on a client, Wi-Fi, or a remote host.

import fcntl, os, pty, struct, subprocess, termios master, slave = pty.openpty() try: for rows, cols in [(24, 80), (18, 38), (30, 92)]: dims = struct.pack('HHHH', rows, cols, 0, 0) fcntl.ioctl(master, termios.TIOCSWINSZ, dims) print(subprocess.check_output(['stty', 'size'], stdin=slave, text=True).strip()) finally: os.close(master) os.close(slave) 

Observed output:

24 80 18 38 30 92 

Add a multiplexer last

If you’re debugging a shared tmux session, repeat with the phone and desktop attached to the same window. In a test pane, compare stty size before and after the phone changes size. Also check tmux show-options -w window-size in the target window. The active sizing policy can choose a size based on the attached clients or keep it fixed, so the phone’s viewport and the pane’s PTY need not match. See the tmux window-size guide. Treat Herdr separately: record the version and measure from inside its pane rather than assuming it applies the same policy.

Write down three things: the two client layouts, the remote rows and columns, and whether anything changes in the other viewer. That turns "the terminal jumped" into a report someone else can reproduce.