about summary refs log tree commit diff
path: root/Functions/Calendar
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Calendar')
-rw-r--r--Functions/Calendar/calendar9
1 files changed, 2 insertions, 7 deletions
diff --git a/Functions/Calendar/calendar b/Functions/Calendar/calendar
index 08903d04c..b3cb58425 100644
--- a/Functions/Calendar/calendar
+++ b/Functions/Calendar/calendar
@@ -352,13 +352,8 @@ fi
   if [[ -n $sched ]]; then
     if [[ $next -ge 0 ]]; then
       # Remove any existing calendar scheduling.
-      # Luckily sched doesn't delete its schedule in a subshell.
-      sched | while read line; do
-	if [[ $line = (#b)[[:space:]]#(<->)[[:space:]]##*[[:space:]]'calendar -s'* ]]; then
-	  # End of pipeline run in current shell, so delete directly.
-	  sched -1 $match[1]
-	fi
-      done
+      i=${"${(@)zsh_scheduled_events#*:*:}"[(I)calendar -s*]}
+      (( i )) && sched -$i
       $sched $next calendar "${calopts[@]}" $next $next
     else
       $showprog $start $stop \