URL: <https://savannah.gnu.org/bugs/?68128>
Summary: History not saved if we get SIGHUP during
PROMPT_COMMAND
Group: The GNU Bourne-Again SHell
Submitter: viinikv
Submitted: Fri 06 Mar 2026 02:07:40 PM UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Unlocked
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 06 Mar 2026 02:07:40 PM UTC By: Ville Viinikka <viinikv>
My Arm SBC constantly hits this timing when running 'sudo reboot' and
PROMPT_COMMAND from Fedora 43 /etc/profile.d/80-systemd-osc-context.sh
How to reproduce:
For illustration, I added this to termsig_handler:
printf("termsig_handler %d %d %d %d\n", sig, interactive_shell, interactive,
remember_on_history);
1. run bash with a slow prompt command
PROMPT_COMMAND='sleep 1' ./bash --norc
2. send SIGHUP while the prompt command is running
(sleep 0.5; kill -SIGHUP $$) &
viinikv@supermicro:~/Software/bash$ PROMPT_COMMAND='sleep 1' ./bash --norc
bash-5.3$ commandtobesaved1
bash: commandtobesaved1: command not found
bash-5.3$ (sleep 0.5; kill -SIGHUP $$) &
[1] 9949
termsig_handler 1 1 0 0
Hangup
viinikv@supermicro:~/Software/bash$ PROMPT_COMMAND='sleep 0' ./bash --norc
bash-5.3$ commandtobesaved2
bash: commandtobesaved2: command not found
bash-5.3$ (sleep 0.5; kill -SIGHUP $$) &
[1] 9959
bash-5.3$
termsig_handler 1 1 1 1
Hangup
viinikv@supermicro:~/Software/bash$
I first posted this on https://savannah.gnu.org/bugs/?68122#comment18 but that
appears to be a different bug.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68128>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
