jml / undistract-me

Notifies you when long-running terminal commands complete
Other
539 stars 48 forks source link

[Trivial] Fix preexec_set_exit from interfering with custom prompt commands #66

Closed rubenwardy closed 4 years ago

rubenwardy commented 4 years ago

It's common to have a custom PROMPT_COMMAND which reads the exit code. This stops undistract-me from interfering with the exit code produced by the program

example of a prompt command reading the exit code:

PROMPT_COMMAND=__prompt_command
__prompt_command() {
    local exit="$?"    # This needs to be first

    # set PS1 here
}

source /usr/share/undistract-me/long-running.bash
notify_when_long_running_commands_finish_install
rubenwardy commented 4 years ago

@jml would be nice to have a review

jml commented 4 years ago

Thanks! I have more or less abandoned maintainership of this repo.