sudofox / shell-mommy

Mommy is here for you on the command line ~ ❤️
394 stars 15 forks source link

FIX: Prompt Command Detection (Also Code Style from PR 16) #19

Open ChristianSilvermoon opened 1 year ago

ChristianSilvermoon commented 1 year ago

I believe I've reasonably solved the the TODO:

TODO: add a way to check if we're running from PROMPT_COMMAND to use the previous exit code instead of doing things this way

By checking if our argument matches what the README suggests for $PROMPT_COMMAND's value, Shell Mommy can be confident that she is in fact, in all likelyhood, running from $PROMPT_COMMAND.

There isn't much of a reason to pass such a strange (and quite unpleasant to properly escape) argument to her otherwise x3

Merging #16 also introduced a strangely formatted If statement that both significantly goes against the current style, but also is (in my opinion, but it is really subjective) harder to read.

So this also brings that If Statement more in-line with the rest of Shell Mommy's If Statements