Replace static _PROMPT/_PROMPT2 with dynamic __prompt(exitcode)/__prompt2(exitcode) functions. Fallback chain: __prompt() → _PROMPT → "> ". Install a default __prompt that shows the current directory with ~ abbreviation. Track last exit code from the REPL loop and pass it to the prompt function.
26 KiB
26 KiB