kostajh / taskwarrior-time-tracking-hook

A simple Taskwarrior hook allowing one to track total time spent on a task.
137 stars 24 forks source link

max_active_tasks Setting is ignored #9

Open timokau opened 9 years ago

timokau commented 9 years ago

Hi! I've got a problem with the max_active_tasks setting. I've set it to 3 in my taskrc and "task show" tells me "max_active_tasks 3" so it seems to be set correctly. However, when I try to start multiple tasks the timetracking hook complains and tells me I should check out the max_active_tasks setting. Have I done something wrong or ist this a bug?

ghost commented 9 years ago

Could you attach your .taskrc-file and the message that is shown when you try to start a second task? In that message the timetracking hook should also print the value of "max_active_tasks". I tried to set max_active_tasks and it works fine for me.

timokau commented 9 years ago

Sure. The "uda.totalactivetime.type = string" was just me messing around with how I can show the time in reports (how can I do that btw?). Also, the messages don't tell me the value of max_active_tasks. It just says "Only 1 task(s) can be active at a time. See 'max_active_tasks' in .taskrc."

Here's the taskrc:

# [Created by task 2.3.0 12/8/2014 22:23:00]
# Taskwarrior program configuration file.
# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-faq',
# 'man task-tutorial', 'man task-color', 'man task-sync' or 'man taskrc'

# Here is an example of entries that use the default, override and blank values
#   variable=foo   -- By specifying a value, this overrides the default
#   variable=      -- By specifying no value, this means no default
#   #variable=foo  -- By commenting out the line, or deleting it, this uses the default

# Use the command 'task show' to see all defaults and overrides

# Files
data.location=~/.task

# Color theme (uncomment one to use)
#include /usr/share/taskwarrior/light-16.theme
#include /usr/share/taskwarrior/light-256.theme
#include /usr/share/taskwarrior/dark-16.theme
#include /usr/share/taskwarrior/dark-256.theme
#include /usr/share/taskwarrior/dark-red-256.theme
#include /usr/share/taskwarrior/dark-green-256.theme
#include /usr/share/taskwarrior/dark-blue-256.theme
#include /usr/share/taskwarrior/dark-violets-256.theme
#include /usr/share/taskwarrior/dark-yellow-green.theme
#include /usr/share/taskwarrior/dark-gray-256.theme

color.due.today=bold red on black

dateformat=y-M-DTHN

# For the timetracking hook
max_active_tasks = 3
uda.totalactivetime.type  = string
uda.totalactivetime.label = Active

report.dsheet.columns     =  start,end,totalactivetime,project,priority,entry.age,description,uuid
report.dsheet.description =  Lists completed tasks from today
report.dsheet.filter      =  status:completed and due:today
report.dsheet.labels      =  Started,Complete,Active,Proj,Pri,Age,Description,UUID
report.dsheet.sort        =  end+,priority-,project+

report.today.columns = id,start.age,entry.age,depends,priority,project,tags,recur,scheduled.countdown,due,until.age,description,urgency
report.today.filter = due:today status:pending

report.unfinished.columns     = id,start.age,entry.age,depends,priority,project,tags,recur,scheduled.countdown,due.age,description,urgency
report.unfinished.description = Unfinished tasks sorted by urgency
report.unfinished.filter      = (status:pending or status:waiting)
report.unfinished.labels      = ID,Active,Age,Deps,P,Project,Tag,Recur,S,Due,Description,Urg
report.unfinished.sort        = urgency-

# Show the due date instead of the due age in the next report
report.next.columns = id,start.age,entry.age,depends,priority,project,tags,recur,scheduled.countdown,due,until.age,description,urgency
ghost commented 9 years ago

@Eisfreak7 It's strange, but could you try to change the "max_active_tasks = 3" in your .taskrc to "max_active_tasks=3". I tried this by myself and it seems to make a difference.

timokau commented 9 years ago

Thanks that works. What a strange syntax. But besides that, is there a possibility to show the time in a report? Preferably not in seconds, but I don't think that'll be possible (since it is saved as a string).