Hacker GitHub

← All repos

rcaloras/bash-preexec

View on GitHub ↗ ★ 1,061 Shell

⚡ preexec and precmd functions for Bash just like Zsh.

10 mentions on Hacker News by 9 people: 1 story, 9 comments · first 2015-09-08 · latest 2025-11-12

Mentions per year 10 mentions · busiest year 2022 (2)
20082026
  1. I wonder if bash-preexec https://github.com/rcaloras/bash-preexec could be used here. Perhaps you could start a timer in a preexec, and stop it in precmd. If the elapsed time is greater than some value, notify-send yourself a message that…
    comment by belden · 2025-02-26 · in Xonsh – A Python-powered shell
  2. …ps://gist.github.com/chmaynard/dbcaed11534dc54bdc90856d18... - Install .bash-preexec.sh in $HOME (see https://github.com/rcaloras/bash-preexec ). - Append this command to your shell startup file (e.g. $BASH_HOME/.bashrc): source…
  3. …use the excellent bash-preexec plugin that atuin itself relies on to achieve this in a cleaner way: https://github.com/rcaloras/bash-preexec
  4. …and it's otherwise easily greppable. When I was still using bash, I had this same thing using https://github.com/rcaloras/bash-preexec .
  5. …part of this submission is the shell script dependency it uses to intercept every command you run: https://github.com/rcaloras/bash-preexec/blob/master/bash-pr... I don’t know rust, but the rust files in the submission look very…
  6. …$$ $(date "+%Y-%m-%dT%H:%M:%S%z") $*" >> ~/.fullhistory It's attached to the preexec hook of https://github.com/rcaloras/bash-preexec , so is run before every command. This means that everything goes into one easily-greppable file, but is…
    comment by misnome · 2021-01-29 · in What am I running inside my bash? (2014)
  7. …it can make my snippet even simpler? edit: Ah, IIUC, PS0 seems bash 4.4+, for better or worse: https://github.com/rcaloras/bash-preexec/issues/28
  8. …as well as each command executed in bash. --- [0] https://github.com/onelittlehope/bash-prompt [1] https://github.com/rcaloras/bash-preexec
    comment by jchoksi · 2016-05-31 · in How and Why to Log Your Bash History
  9. …even just before executing a command. I'm kind of nervous if my string quoting is safe though. [1] https://github.com/rcaloras/bash-preexec
    comment by leni536 · 2015-09-08 · in “I have [bash] history back to ~2003”