mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-19 20:18:07 +00:00
bash: use passed exit status in precmd
The Bash 4.4+ prompt hook saves the command status before doing its own work and passes it to __ghostty_precmd. The function ignored that argument and instead read the hook invocation status, causing command end markers to report zero. Use the explicit argument when present while retaining the current status fallback required by the older bash-preexec path. See #14247
This commit is contained in:
@@ -134,7 +134,7 @@ _ghostty_executing=""
|
||||
_ghostty_last_reported_cwd=""
|
||||
|
||||
function __ghostty_precmd() {
|
||||
local ret="$?"
|
||||
local ret="${1:-$?}"
|
||||
if test "$_ghostty_executing" != "0"; then
|
||||
_GHOSTTY_SAVE_PS1="$PS1"
|
||||
_GHOSTTY_SAVE_PS2="$PS2"
|
||||
|
||||
Reference in New Issue
Block a user