Skip to main content

Module shell

Module shell 

Source
Expand description

The shell integration scripts, and how a shell is started with them.

The person’s own rc is never replaced. zsh gets a ZDOTDIR shim that sources the real .zshenv, .zprofile and .zshrc and then the integration; bash gets an --rcfile that sources ~/.bashrc first; fish gets its init command. A shell forge does not know starts with no integration, and the classifier says heuristic.

Re-exports§

use std::collections::HashMap; 🔒
use std::path::Path; 🔒
use std::path::PathBuf; 🔒

Structs§

ShellPlan
How one shell is started, and the shim directory it needs.

Constants§

BASH
The bash integration: PROMPT_COMMAND closes the previous command and opens the prompt, a DEBUG trap opens the command.
FISH
The fish integration: the fish_prompt and fish_preexec events.
ZSH
The zsh integration: precmd closes the previous command and opens the prompt, preexec opens the command.

Functions§

bash_plan 🔒
clone_env 🔒
The environment the shell starts with: the seat’s own, plus what the PTY’s terminal type answers to. The seat’s env carries forge’s launch terminal’s TERM, which is not what this shell is attached to.
fish_plan 🔒
make_shim 🔒
A fresh shim directory under the system temp dir.
plan
Build the command for shell, with the integration its name supports.
warn_unavailable 🔒
A missing integration is said, not discovered later as a password prompt. Without the marks the shell falls back to the heuristic, which is forge’s own problem to know about.
zsh_plan 🔒