Documentation
¶
Overview ¶
Package shell installs and removes shell hooks that trigger notifications on command completion.
Index ¶
- func DetectShell() string
- func EscapePowerShell(s string) string
- func Install(shell string, threshold int, notifyPath string) (string, error)
- func IsInstalled(shell string) (configPath string, installed bool, err error)
- func ShellConfigPath(shell string) (string, error)
- func Snippet(shell string, threshold int, notifyPath string) string
- func Uninstall(shell string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectShell ¶ added in v0.2.25
func DetectShell() string
DetectShell returns the current shell type: "bash", "zsh", or "powershell". On Windows it defaults to "powershell". On Unix it inspects $SHELL.
func EscapePowerShell ¶
EscapePowerShell doubles single quotes for safe embedding inside PowerShell single-quoted strings.
func Install ¶ added in v0.2.25
Install appends the shell hook snippet to the shell's config file. Returns an error if the hook is already installed.
func IsInstalled ¶ added in v0.2.25
IsInstalled checks whether the shell hook markers are present in the config file.
func ShellConfigPath ¶ added in v0.2.25
ShellConfigPath returns the config file path for the given shell.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.