taskwarrior-tui icon indicating copy to clipboard operation
taskwarrior-tui copied to clipboard

Context switcher: numeric hotkeys

Open simonmeggle opened this issue 3 years ago • 10 comments

Thanks for implementing the "select on move" feature in context switcher. I had another idea I want to suggest: the context switcher could display numeric indices as the first column. For users which switch contexts very often (like me) it would be handy just to type c,4,ENTER so activate the new context. But, only a suggestion; it's great anyway :-)

simonmeggle avatar Jan 14 '22 06:01 simonmeggle

I like the idea of a faster context switcher. I'll have to think about this a little more.

Btw, the number keys are for running shortcuts. So you could bind 4 in the task report view to run task context fourth_context. See shortcuts documentation over here: https://kdheepak.com/taskwarrior-tui/configuration/advanced/

kdheepak avatar Jan 15 '22 00:01 kdheepak

I tried to implement this and it's really laggy. When you hit j or k, the interface lags for half a second while the subprocess runs to switch the context. I think multiple shortcuts to switch preferred contexts is the way to go for now. Maybe once I refactor, I'll be able to look into it again.

kdheepak avatar Jan 24 '22 16:01 kdheepak

No problem. I apreciate your efforts!

simonmeggle avatar Jan 24 '22 17:01 simonmeggle

I like the idea of a faster context switcher. I'll have to think about this a little more.

Btw, the number keys are for running shortcuts. So you could bind 4 in the task report view to run task context fourth_context. See shortcuts documentation over here: https://kdheepak.com/taskwarrior-tui/configuration/advanced/

I have tried this, and I can see the command being executed, but the interface is not "refreshed" or changed.

This goes for both "task context x" and doing the same via a script.

I am using 0.18.4, taskwarrior 2.6.1 on Linux Mint

CleanAir777 avatar Jan 27 '22 10:01 CleanAir777

Can you try hitting r to do a manual refresh? If that works, then I know what the problem is and I’ll fix it. If that didn’t work, then the shortcut is failing for some reason.

kdheepak avatar Jan 27 '22 12:01 kdheepak

Yes, I tried 'r', but it doesn't refresh. When I exit tw-tui, I can anly see messages stating that the context change was succesful. I did make a screenshot showing the context menu after using the shortcut, and that display is not 100% either twtui-vb . This screenshot is taken when having switched from "thuis" context to "werk".

CleanAir777 avatar Jan 27 '22 13:01 CleanAir777

Hmm. Does changes using the context menu work?

kdheepak avatar Jan 27 '22 13:01 kdheepak

Using the context menu works as expected.

CleanAir777 avatar Jan 27 '22 13:01 CleanAir777

Thanks for reporting! You are right, it doesn't change with shortcuts. I've fixed it, and this fix should be available in https://github.com/kdheepak/taskwarrior-tui/releases/tag/v0.18.5

kdheepak avatar Jan 27 '22 14:01 kdheepak

Very fast work!. I have installed the new version, and it works as expected now!

CleanAir777 avatar Jan 27 '22 15:01 CleanAir777