Conversation
Notices
-
Angry Sun (sun@shitposter.world)'s status on Friday, 21-Jun-2024 19:41:57 UTC Angry Sun I want shell command history that just actually records my history, 80% of the time it gets lost and I don't know why -
Santa Claes πΈπͺππ°π (clacke@libranet.de)'s status on Friday, 21-Jun-2024 19:41:55 UTC Santa Claes πΈπͺππ°π @sun @meowski I'm probably and hopefully wrong, but syncing on every prompt feels like it would increase the risk of messing up the whole history file.
The trick I learned was to set a `trap 'history -a' EXIT` that saves the history regardless how the shell is closed.
When I want to transfer history between two running shells, I run those two commands manually, but maybe it would be a cool experience to always have history synced between running sessions.
Also: Don't forget to drastically increase HISTSIZE and HISTFILESIZE, as the defaults are far too low.
-
Meowski's Catgirl Grooming Service (meowski@fluf.club)'s status on Friday, 21-Jun-2024 19:41:56 UTC Meowski's Catgirl Grooming Service @sun right away every time you enter a command? what is it? -
Angry Sun (sun@shitposter.world)'s status on Friday, 21-Jun-2024 19:41:56 UTC Angry Sun @meowski I was told to do this:
shopt -s histappend
PROMPT_COMMAND='history -a;history -n' -
Meowski's Catgirl Grooming Service (meowski@fluf.club)'s status on Friday, 21-Jun-2024 19:41:57 UTC Meowski's Catgirl Grooming Service @sun in bash it only saves when exiting cleanly, ctrl+d instead of closing the window -
Angry Sun (sun@shitposter.world)'s status on Friday, 21-Jun-2024 19:41:57 UTC Angry Sun @meowski thank you I found a bashrc entry that will save it right away
-