Skip to main content

Module platform

Module platform 

Source

Functions§

apply_profile_free_env
Neutralizes inherited startup-file hooks so a non-login/non-interactive sh -c / bash -c cannot be hijacked into sourcing a profile or rc file (#451). lean-ctx runs the system POSIX shell profile-free and deterministic; a stray inherited BASH_ENV (read by bash even for bash -c) or ENV pointing at e.g. an exec nu snippet would otherwise silently replace the shell. Cleared to empty so the expansion names no file. No-op in effect for PowerShell/cmd, which ignore both variables.
apply_utf8_locale
Sets LC_CTYPE=C.UTF-8 when no UTF-8 locale is inherited from the parent process. Without this, commands treat bytes >127 as non-printable (C locale), mangling Cyrillic, CJK, emoji, etc.
decode_output
is_container
Detects if the current process runs inside a Docker/container environment.
is_non_interactive
Returns true if stdin is NOT a terminal (pipe, /dev/null, etc.)
is_powershell
Returns true when shell_path points to a PowerShell executable.
join_command
Join multiple CLI arguments into a single command string, using quoting conventions appropriate for the detected shell.
join_command_for
resolve_carriage_returns
Resolve carriage-return (\r) progress overwrites in captured output.
resolve_powershell_profile_path
Resolve the active current-user PowerShell profile path.
shell_and_flag
shell_name
Returns a short, human-readable shell name (e.g. “bash”, “zsh”, “powershell”, “cmd”).
zsh_safe_command
Wrap a command to disable zsh nomatch and equals (GH #1439, #1448).