News for hackers. Stuff that matters.
Re:Xonsh – A Python-Powered Shell by isr on Tuesday February 25, 2025 @08:59PM (#43179806)
> (bash won't let me automatically run a command before and after each interactive command I execute, which I want for task completion notifications

Not to put you off investigating alternative shells (I've spent time with rc shell, xonsh (and tako), and even turned gauche scheme & tcl into a commandline shell), but isn't your bash problem solved by using $PS1 to launch your own functions to do whatever?

At least, you can use $PS1 for the "after command" bit. For pre-command, just use a simple 1 letter wrapped script which does whatever, and then exec's the remaining arguments (aka "Bernstein chaining")

(unless I've gotten the wrong end of the stick, and am missing what you meant)

Re:Xonsh – A Python-Powered Shell by rendaw on Tuesday February 25, 2025 @09:13PM (#43179873)
No, not at all! Yeah I could do that, and it's something I considered, but I feel like working in a shell shouldn't be such an unrelenting hack. FWIW I think every shell _but_ bash supports it, I was just hoping to move to something that's overall nice to use in the process.
Re:Xonsh – A Python-Powered Shell by belden on Wednesday February 26, 2025 @01:48AM (#43181332)
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 a long-running command has finished.

Re:Xonsh – A Python-Powered Shell by shiomiru on Tuesday February 25, 2025 @09:59PM (#43180119)
Another solution for the pre-command part is "trap 'some command' DEBUG".
Re:Xonsh – A Python-Powered Shell by isr on Thursday February 27, 2025 @12:44PM (#43196609)
Didn't know about that. Thanks!