Documentation
¶
Overview ¶
Package shell provides shell integration and completion support.
This package embeds shell integration scripts that provide enhanced nssh functionality when sourced in the user's shell configuration.
Shell Integration Features ¶
The integration scripts provide:
- Subcommand routing: detects nssh subcommands vs hostnames
- Shell history: adds successful connections to shell history
- Atuin integration: records commands in Atuin if available
- Visual feedback: arrow prefix for connection commands (-> nssh hostname)
Supported Shells ¶
Scripts are provided for:
- Bash and Zsh: BashZshIntegration (nssh-shell-integration.sh)
- Fish: FishIntegration (nssh-shell-integration.fish)
Installation ¶
Shell integration is installed by "nssh self init", which:
- Copies the appropriate script to ~/.local/share/nssh/
- Adds a source line to the shell's rc file (.bashrc, .zshrc, or config.fish)
Script Location ¶
The scripts are embedded via go:embed from the scripts/ subdirectory. At runtime they are written to $XDG_DATA_HOME/nssh/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BashZshIntegration string
BashZshIntegration contains the shell integration script for bash and zsh. This script provides: - Subcommand routing (detect host, ctx, etc. vs hostname) - Shell history integration (bash history -s, zsh print -s) - Atuin integration if available - Arrow output for connection commands (-> nssh hostname)
var FishIntegration string
FishIntegration contains the shell integration script for fish. This script provides the same features as BashZshIntegration but using fish shell syntax.
Functions ¶
This section is empty.
Types ¶
This section is empty.