jml / undistract-me

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

Function names in PROMPT_COMMAND are difficult to track down #30

Open dimo414 opened 9 years ago

dimo414 commented 9 years ago

Related to issue #20 I discovered my PROMPT_COMMAND was being populated with a couple functions, but I had no idea what was doing it:

$ echo $PROMPT_COMMAND
preexec_set_exit;preexec_invoke_cmd

Googling around for "preexec" and so on only found Glyph Lefkowitz's hack, but no insight as to why it was inexplicably installed on my machine.

I happened to discover that declare -F prints the filename where a function is defined, and was able to trace the source back to undistract-me, but it was much more roundabout than it should have been.

It'd be great if the function(s) added to PROMPT_COMMAND were wrappers around the preexec behavior and given more meaningful names, so that people can easily discern where they're coming from.

jml commented 9 years ago

That sounds like a sensible idea. I'm probably not going to get to this any time soon, but would welcome a patch.

dimo414 commented 9 years ago

I uninstalled undistract-me in frustration as soon as I found the culprit, so I probably won't be submitting a patch :) Best of luck though.