blakesweeney / unite-taskwarrior

A unite.vim interface to taskwarrior
6 stars 2 forks source link

g:unite_taskwarrior_use_AnsiEsc = 1 #42

Closed linuxcaffe closed 9 years ago

linuxcaffe commented 9 years ago

Using :Unite taskwarrior/cmd stats (for example) the task stats report is displayed with escape-color-characters, looks something like;

^[[38;5;232m^[[48;5;247mCategory                 ^[[0m  ^[[38;5;232m^[[48;5;247mData         ^[[0m
^[[38;5;232m^[[48;5;247m-------------------------^[[0m  ^[[38;5;232m^[[48;5;247m-------------^[[0m
Pending                    190
Waiting                    0
Recurring                  10
Completed                  155
Deleted                    234
...

Taskwiki can generate taskwarrior graphic reports too, and the same thing happened there. Tomas overcame that by optionally incorporating vim-plugin-AnsiEsc (https://github.com/powerman/vim-plugin-AnsiEsc) to correctly display these taskwarrior theme colors. Maybe utw could too!?

this idea carried on from #18

linuxcaffe commented 9 years ago

With use_AnsiEsc = 0 (the default, the way it is now) taskwarrior escape-codes should be stripped out or suppressed with rc.color=off

blakesweeney commented 9 years ago

Could you give an example of how you use this source? It was actually added by someone else and I don't find it terribly useful.

linuxcaffe commented 9 years ago

afaik, taskwiki optionally uses AnsiEsc to display chart colors and that's about it. If there's an easier way to display ansi colors, great, and if not, the stray color codes can be suppressed;

I realize now that the taskwiki_source_tw_colors function is a different thing entirely.

blakesweeney commented 9 years ago

I meant could you give an example of input to the source that does something useful for you?

linuxcaffe commented 9 years ago

I guess i'm just saying that the output of taskwarrior/cmd burndown (for example) could be rendered with taskwarrior colors, OR those codes should be suppressed. (suppress for now, towards v1.0)

blakesweeney commented 9 years ago

I was just trying to work on this and I've run into an issue. I see not ascii coloring output when I use cmd. So I can't really get it color by ascii codes then. Do you still see color codes in the output?

linuxcaffe commented 9 years ago

yes I do, as in http://picpaste.com/utw_summary_screenshot-3k9Exk2L.png

blakesweeney commented 9 years ago

Ah ok. I didn't set _forcecolor in my taskrc. I can reproduce your issue now so I can try to fix it.

blakesweeney commented 9 years ago

I've fixed this. Now the results of task info or a command will be colored if ansiesc is installed. However, this does change the behavior in that it now creates a buffer to display the results. I think this is required for ansiesc to work so there's not much I can do about it. Take a look at let me know what you think.

blakesweeney commented 9 years ago

As far as I can tell this is fixed now. If you have any other suggestions for it feel free to reopen, but I'm closing it for now.