How Shell Prompt Customization Actually Works
A colorful prompt showing git branch and exit code is not a separate program - it is a string the shell re-evaluates before every command.
Bash, Zsh, sh, tcsh, and the TUI tools built on top of them - prompts, scripting, multiplexers, and terminal troubleshooting.
A colorful prompt showing git branch and exit code is not a separate program - it is a string the shell re-evaluates before every command.
An unquoted variable works in testing, then silently breaks the first time its value contains a space - the single most common shell scripting bug.
Terminal and shell are separate programs linked by a kernel pty: one renders characters and handles input, the other interprets commands.
Full-screen terminal apps like htop and vim redraw the screen selectively and read keystrokes one at a time. This is the library layer that makes it possible.
Bash rewrites typed commands through an ordered sequence of expansions before running them. The exact order explains most quoting and globbing surprises.
A command mid-pipeline dies with 'Broken pipe,' often only when piped into head - a specific, well-defined signal, not a random failure.
A prompt showing broken characters or startup errors after a theme update - how to isolate whether it's a font, config, or version issue.
A tool you just installed is definitely on disk, but the shell insists it doesn't exist - almost always a PATH problem, with only a few actual explanations.
TUI apps render clipped over SSH, or the terminal doesn't rewrap after resizing - the remote shell has a stale idea of the terminal's actual dimensions.
A shortcut that works outside tmux does something different, or nothing, inside a session - how the prefix key and keybinding layers interact.