Startup Command FAQ
How does the Startup Command setting work for SSH connections?
The startup command feature allows a user to define a command that will be used instead of starting the default shell. For example, you could connect directly to tmux rather than spawning a shell, and then opening tmux in that shell.
This can be useful in a number of ways. For example, closing a tmux session also closes the connection completely, rather than forcing the user to additionally exit the shell after closing tmux.
Legacy versions of Prompt
In Prompt 2, the startup command would run within the default shell, which caused incompatibilities for some users who were expecting the default SSH behavior.
In rare cases, SSH servers do not allow users to directly spawn a shell. The default startup command behavior is essential for these configurations.
How does the Startup Command setting work for Mosh and Eternal Terminal connections?
On these servers, the Startup Command setting is used during the preliminary SSH negotiation required in order to start the session. Both Mosh and Eternal Terminal connections first connect to the server via SSH to run a command on the server to agree on encryption, then they disconnect from SSH and establish a connection over their own protocol with the agreed-upon encryption.
Unlike SSH, the Mosh and ET servers always open shells when connecting over their own protocols. The Startup Command is only supported for the initial SSH negotiation.
What is the recommended way to run a command within a shell every time I connect to a server?
To run a command within a shell every time you connect, we recommend adding the command to your shell’s rc
file on the destination server.