summaryrefslogtreecommitdiff
path: root/functions/fish_prompt.fish
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-11-16 21:46:40 +0100
committerache <ache@ache.one>2017-11-16 21:46:40 +0100
commit8ebd75be8fd1fd3375393742eb5ea5d6ed7dea22 (patch)
treef82411badee140eeed998b12eda2937d2d3f1e49 /functions/fish_prompt.fish
parentSet default editor to vim (diff)
Todo fix
Diffstat (limited to 'functions/fish_prompt.fish')
-rw-r--r--functions/fish_prompt.fish14
1 files changed, 8 insertions, 6 deletions
diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish
index 180359d..b66528a 100644
--- a/functions/fish_prompt.fish
+++ b/functions/fish_prompt.fish
@@ -129,13 +129,15 @@ function prompt_shlv -d "Display level shell"
end
function prompt_todo -d "Display todo"
- set all (todo | wc -l)
- set chkd (todo checked | wc -l)
- set td (math "$all-$chkd")
+ if which todo ^ /dev/null > /dev/null
+ set all (todo | wc -l)
+ set chkd (todo checked | wc -l)
+ set td (math "$all-$chkd")
- if [ $all -gt 0 ]
- prompt_segment 5C5C5C blue "$td/$all"
- end
+ if [ $all -gt 0 ]
+ prompt_segment 5C5C5C blue "$td/$all"
+ end
+ end
end