GothenburgBitFactory / taskwarrior

Taskwarrior - Command line Task Management
https://taskwarrior.org
MIT License
4.22k stars 282 forks source link

Override context on specific terminals #3053

Open rmonicovia opened 1 year ago

rmonicovia commented 1 year ago

I'd like to open a terminal A where I see my personal stuff. And have at same time a terminal B where I see my work stuff. And may a terminal C with something else. Today to achieve this I need to pass rc.context:blergs to every command or have aliases, variables, etc, its too painful!

dathanb commented 1 year ago

This does seem like it'd be a good addition. Maybe have taskwarrior read the .taskrc file and then look for environment variables named with a particular convention and apply those as overrides.

For the task command, it's pretty easy to fake that:

$ alias task='command task ${TASKWARRIOR_CONTEXT:+rc.context:${TASKWARRIOR_CONTEXT}}'

Then in each terminal you'd set the environment variable TASKWARRIOR_CONTEXT=work or whatever context you want to use, and it'll get picked up by the task alias.

I'm not aware of a similar workaround for tasksh right now, though.