pub struct AttachHeader {
pub name: String,
pub local_tty_size: TtySize,
pub local_env: Vec<(String, String)>,
pub ttl_secs: Option<u64>,
pub cmd: Option<String>,
pub dir: Option<String>,
pub start_cmd: Option<String>,
}Expand description
AttachHeader is the blob of metadata that a client transmits when it first dials into the shpool daemon indicating which shell it wants to attach to.
Fields§
§name: StringThe name of the session to create or attach to.
local_tty_size: TtySizeThe size of the local tty. Passed along so that the remote pty can be kept in sync (important so curses applications look right).
local_env: Vec<(String, String)>A subset of the environment of the shell that shpool attach is run
in. Contains only some variables needed to set up the shell when
shpool forks off a process. For now the list is just SSH_AUTH_SOCK
and TERM.
ttl_secs: Option<u64>If specified, sets a time limit on how long the shell will be open when the shell is first created (does nothing in the case of a reattach). The daemon is responsible for automatically killing the session once the ttl is over.
cmd: Option<String>If specified, a command to run instead of the users default shell.
dir: Option<String>If specified, the directory to start the shell in. If not, $HOME should be used.
start_cmd: Option<String>If specified, shpool will inject the given command into the shell
when it first starts up. This option is ignored for reattaches.
Note that this differs from the cmd option in that it is run
directly in the shell rather than replacing the shell. Think of
it as running source cmd rather than exec cmd. The main
usecase is to be able to automatically enter some useful context
such as a particular directory with a python virtual environment
already set up for example.