You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a really interesting one, nice find. I'll have to do some digging, but this might end up being a bash bug, in which case I'm not sure we can fix it.
Rycieos
added
runtime
Related to the generation and display of runtime of a command
and removed
help wanted
An issue where ideas or patches are welcome
labels
Jul 7, 2020
If the user hits enter on a empty prompt, Bash doesn't execute a
command, so it doesn't call the DEBUG trap. This means the DEBUG trap
for the $PROMPT_COMMAND would be the first, and it was catching the
"start of command" path, and not the "end of command" path. This meant
the next empty return would take the "end of command" path, and display
a runtime.
Remove the `elif`, and make the one DEBUG call possible to go down both
paths.
Related #614
Ok, this wasn't a complete fix. Turns out that if you hit enter on an empty prompt, Bash runs $PROMPT_COMMAND, but since it doesn't run any command, it doesn't run a DEBUG trap for the non-existant command. Duh. This means if you press enter twice on an empty prompt, it will show timing on the second one (if enough time passed). Fixed in 25cd5dc
Shell: bash 5.0.3(1)-release
Operating system: Linux 4.19.0-9-amd64 (2020-06-07), Debian GNU/Linux 10 (buster)
Liquidprompt version: 869d4ab
Steps to Reproduce
LP_ENABLE_RUNTIME=1
andLP_RUNTIME_THRESHOLD=5
sleep 2 | sleep 6
Expected Behavior
The prompt should report "6s".
Current Behavior
The prompt reports no time.
The text was updated successfully, but these errors were encountered: