That's interesting. So, I wonder what differs between your setup and mine. On mine it looses the all the commands from that session (from the current power up to power down) when shutting down via the power button.Sorry if this is unclear. Try this test:
On a RPi 5, running Bookworm, with a Desktop:
Open a terminal, type 'history'.
Type in a new command.
Shutdown with Shutdown->Shutdown.
Restart.
Open a terminal, type 'history'.
The last command is added to the end of the history , on my setup.
Type in a new command.
Shutdown with a double press to the power button.
Restart.
Open a terminal, type 'history'.
The last command is not added to the end of the history, on my setup.
Suspect (although not tested) the same will occur if sshing to the Pi.
FWIW...
I've tried every scenario I can think of using a keyboard/mouse/monitor and via SSH and I cannot reproduce your problem.
On Desktop, the power button is not a "double-click" as one normally associates with a mouse. The first press of the power button brings up the "Shutdown Options" dialog. Another press (regardless of how much later as long the "Shutdown Options" dialog is still up) actually starts the shutdown process.
On Lite, the first press of the power button immediately starts the shutdown process.
I don't find the last command is ever lost from the history no matter what.
Didn't know about the single click off for Lite. might have a play with that. It sounds like the problems is timing related, in that bash doesn't have enough time to save the history on my system before shutdown is forced as described by BigRedMailbox, above.
Thanks for taking the time to test.
Statistics: Posted by ddwwcc — Thu May 16, 2024 9:19 pm