Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list names are not appearing in color #251

Closed
RJ722 opened this issue Jun 14, 2017 · 26 comments
Closed

list names are not appearing in color #251

RJ722 opened this issue Jun 14, 2017 · 26 comments

Comments

@RJ722
Copy link

RJ722 commented Jun 14, 2017

Hello!

When I changed my machine recently, lists stop appearing coloured. I am not sure if this is OS related because I have shifted from Linux (zsh) -> Mac OS X (zsh). Other than this, other colors are working, for eg.: the todo's date turns red after deadline.

Additional information:

  • tree structure for lists.
/Users/rahuljha/.local/share/calendars/
├── GSoC
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── color
│   ├── colour
│   ├── [email protected]
│   └── [email protected]
├── OSS
│   ├── [email protected]
│   ├── [email protected]
│   └── color
├── Personal
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── color
│   └── [email protected]
├── Roboclub
│   ├── [email protected]
│   └── color
└── chores
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    └── color

5 directories, 26 files

I even tried renaming the file to colour 😆

  • Output of cat ~/.local/share/calendars/**/*color
#00FF00
#ff0000
#ff00ff
#00ff00
#0000FF
  • Should I also upload a screenshot?

Thank you for such an awesome product!

@RJ722 RJ722 changed the title no colorised output list names are not appearing in color Jun 14, 2017
@RJ722
Copy link
Author

RJ722 commented Jun 14, 2017

IMHO it's probably because of some sort of encoding error.

I did a little experiment:
I installed todoman in an empty virtualenv, set up dev and docs requirements and ran tox without any changes, bam:

78 failed, 76 passed, 1 skipped, 3 xfailed in 133.11 seconds

All of them had an error message similar to:

E       AssertionError: assert not RuntimeError('Click will abort further execution because Python 3 was configured to use ASCII as encoding for the envi... sk_SK.UTF-8, sl_SI.UTF-8, sr_YU.UTF-8, sv_SE.UTF-8, tr_TR.UTF-8, uk_UA.UTF-8, zh_CN.UTF-8, zh_HK.UTF-8, zh_TW.UTF-8',)
E        +  where RuntimeError('Click will abort further execution because Python 3 was configured to use ASCII as encoding for the envi... sk_SK.UTF-8, sl_SI.UTF-8, sr_YU.UTF-8, sv_SE.UTF-8, tr_TR.UTF-8, uk_UA.UTF-8, zh_CN.UTF-8, zh_HK.UTF-8, zh_TW.UTF-8',) = <Result RuntimeError('Click will abort further execution because Python 3 was configured to use ASCII as encoding for ...sk_SK.UTF-8, sl_SI.UTF-8, sr_YU.UTF-8, sv_SE.UTF-8, tr_TR.UTF-8, uk_UA.UTF-8, zh_CN.UTF-8, zh_HK.UTF-8, zh_TW.UTF-8',)>.exception

Along with a log:

# Sphinx version: 1.6.2
# Python version: 3.6.1 (CPython)
# Docutils version: 0.13.1 release
# Jinja2 version: 2.9.6
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/Users/rahuljha/Documents/todoman/.tox/docs/lib/python3.6/site-packages/sphinx/cmdline.py", line 305, in main
    opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
  File "/Users/rahuljha/Documents/todoman/.tox/docs/lib/python3.6/site-packages/sphinx/application.py", line 168, in __init__
    confoverrides or {}, self.tags)
  File "/Users/rahuljha/Documents/todoman/.tox/docs/lib/python3.6/site-packages/sphinx/config.py", line 150, in __init__
    execfile_(filename, config)
  File "/Users/rahuljha/Documents/todoman/.tox/docs/lib/python3.6/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
    exec_(code, _globals)
  File "conf.py", line 95, in <module>
  File "conf.py", line 46, in write_section
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 59: ordinal not in range(128)

I can't really make a lot of sense out of it atm.
FWIW, my terminal is using UTF-8 text-encoding.

@WhyNotHugo
Copy link
Member

Hmm... Not entirely sure what the issue is yet, can you:

  • Run echo "\033[0;36mBLAH". Is this colourized? It probably should be, since I don't think the issue is with your terminal.
  • Can you paste the output of env? I'd like to see if there's any odd language/encoding settings that might get in the way.

TBH, none of the devs use macOS, but I think some users do. FWIW, test run fine on macOS on travis, so it should work just fine. I've no problem supporting it if you're willing to provide the feedback required though.

@RJ722
Copy link
Author

RJ722 commented Jun 14, 2017

Run echo "\033[0;36mBLAH". Is this colourized? It probably should be, since I don't think the issue is with your terminal.

It indeed is colored.

Here's the output of env:

TMPDIR=/var/folders/9p/6q_p_sjj7h3_ywvv8jdzvw500000gn/T/
TERM_PROGRAM_VERSION=388
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.oz7nUoXxdQ/Render
LC_CTYPE=UTF-8
TERM_PROGRAM=Apple_Terminal
XPC_SERVICE_NAME=0
XPC_FLAGS=0x0
TERM_SESSION_ID=3F4B3CD8-427A-41DC-A051-6D07D36378AF
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.NyxqWIlghV/Listeners
TERM=xterm-256color
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
SHELL=/bin/zsh
HOME=/Users/rahuljha
LOGNAME=rahuljha
USER=rahuljha
PATH=/Users/rahuljha/.virtualenvs/coala_dev/bin:/Users/rahuljha/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
SHLVL=1
PWD=/Users/rahuljha/Documents
OLDPWD=/Users/rahuljha/Documents/vulture
ZSH=/Users/rahuljha/.oh-my-zsh
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
WORKON_HOME=/Users/rahuljha/.virtualenvs
VIRTUALENVWRAPPER_PROJECT_FILENAME=.project
VIRTUALENVWRAPPER_WORKON_CD=1
VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
VIRTUALENVWRAPPER_HOOK_DIR=/Users/rahuljha/.virtualenvs
PS1=(coala_dev) ${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)
VIRTUAL_ENV=/Users/rahuljha/.virtualenvs/coala_dev
_=/usr/bin/env

TBH, none of the devs use macOS, but I think some users do. FWIW, test run fine on macOS on travis, so it should work just fine. I've no problem supporting it if you're willing to provide the feedback required though.

Thank You very much @hobarrera ! I will be actively providing any information and feedback you might need 😄

@WhyNotHugo
Copy link
Member

Hm, so merely setting LC_CTYPE=UTF-8 for me reproduces the issues you see on tests, so I'll try to work from that.

@RJ722
Copy link
Author

RJ722 commented Jun 14, 2017

I changed LC_CTYPE to en_US.UTF-8 now and tests appear to go fine, but the lists aren't coloured yet!

@RJ722
Copy link
Author

RJ722 commented Jun 21, 2017

Just switching from terminal to iTerm2 got me the coloured output.

I will try and investigate the differences, what should I look for?

@untitaker
Copy link
Member

could you output env | grep LC and env | grep LANG in both?

@RJ722
Copy link
Author

RJ722 commented Jun 21, 2017

env | grep LC gives LC_CTYPE=UTF-8 in both.

Here's the output of env:

on terminal:

TMPDIR=/var/folders/9p/6q_p_sjj7h3_ywvv8jdzvw500000gn/T/
TERM_PROGRAM_VERSION=388
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.MfTzoKOEQH/Render
LC_CTYPE=UTF-8
TERM_PROGRAM=Apple_Terminal
XPC_SERVICE_NAME=0
XPC_FLAGS=0x0
DISPLAY=/private/tmp/com.apple.launchd.JHNQoP8UHS/org.macosforge.xquartz:0
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.5Of11j14Jg/Listeners
TERM=xterm-256color
TERM_SESSION_ID=DD82BAF7-816E-42F1-BA5D-F8118CD7BE13
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
SHELL=/bin/zsh
HOME=/Users/rahuljha
LOGNAME=rahuljha
USER=rahuljha
PATH=/Users/rahuljha/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
SHLVL=1
PWD=/Users/rahuljha
OLDPWD=/Users/rahuljha
ZSH=/Users/rahuljha/.oh-my-zsh
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
WORKON_HOME=/Users/rahuljha/.virtualenvs
VIRTUALENVWRAPPER_PROJECT_FILENAME=.project
VIRTUALENVWRAPPER_WORKON_CD=1
VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
VIRTUALENVWRAPPER_HOOK_DIR=/Users/rahuljha/.virtualenvs
_=/usr/bin/env

on iTerm2:

TERM_SESSION_ID=w0t0p1:12C68B73-7A05-4C4D-9CEA-8EA7D6722573
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.5Of11j14Jg/Listeners
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.MfTzoKOEQH/Render
COLORFGBG=7;0
ITERM_PROFILE=Default
XPC_FLAGS=0x0
PWD=/Users/rahuljha
SHELL=/bin/zsh
LC_CTYPE=UTF-8
TERM_PROGRAM_VERSION=3.0.15
TERM_PROGRAM=iTerm.app
PATH=/Users/rahuljha/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
DISPLAY=/private/tmp/com.apple.launchd.JHNQoP8UHS/org.macosforge.xquartz:0
TERM=xterm-256color
HOME=/Users/rahuljha
TMPDIR=/var/folders/9p/6q_p_sjj7h3_ywvv8jdzvw500000gn/T/
USER=rahuljha
XPC_SERVICE_NAME=0
LOGNAME=rahuljha
ITERM_SESSION_ID=w0t0p1:12C68B73-7A05-4C4D-9CEA-8EA7D6722573
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
SHLVL=1
OLDPWD=/Users/rahuljha
ZSH=/Users/rahuljha/.oh-my-zsh
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
WORKON_HOME=/Users/rahuljha/.virtualenvs
VIRTUALENVWRAPPER_PROJECT_FILENAME=.project
VIRTUALENVWRAPPER_WORKON_CD=1
VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
VIRTUALENVWRAPPER_HOOK_DIR=/Users/rahuljha/.virtualenvs
_=/usr/bin/env

@aleprovencio
Copy link

What colors besides due dates should be shown, I am missing something? I have khal showing all the colors even detecting them through metadata for each of my calendars, but can't see any of that on todoman. Can any of you please put a screenshot?

@untitaker
Copy link
Member

2018-01-18-212817_635x74_scrot

Try switching to iTerm 2, I think it's an issue with RGB colorcodes not being supported by the other terminals

@untitaker
Copy link
Member

Looking back at this it's obvious what the issue is: your terminal doesn't support the ansi codes we use to produce full RGB colors. vte3-based terminals on Linux and iTerm 2 apparently do support that.

We should document this.

@aleprovencio
Copy link

aleprovencio commented Jan 18, 2018

thanks @untitaker. Forget it, I started from scratch deleting old cache and making a fresh vdirsync discover, sync and metasync. I can see the colors now! :)
This is termite terminal FYI.

@untitaker
Copy link
Member

Oh, I thought you were on a Mac. I am on Termite too.

@untitaker
Copy link
Member

closing for #297

@WhyNotHugo
Copy link
Member

Actually, I think you've found a bug!

If a whole list is cached before running vdirsyncer metasync, and then you run todo, it'll never expire that cache, and will never pick up the new colour information.

Nice corner case you've found here!

@aleprovencio
Copy link

That is cool, glad I could help somehow. :)

@WhyNotHugo
Copy link
Member

I've opened #251 to follow up on that specifically.

@aleprovencio
Copy link

I guess you meant #298.

@WhyNotHugo
Copy link
Member

Yup, my bad!

@potuz
Copy link

potuz commented Sep 3, 2018

I apologize if it's not the right channel to ask for help, but is it rxvt-unicode compatible with this? The command echo "\033[0;36mBLAH" will not come colorized but something like

perl -e 'print "\033[48;5;168mBlah\033[0m\n"';

Does print in color.

@WhyNotHugo
Copy link
Member

Apparently, there seem to be some caveats regarding urxvt and truecolor support. But it should be supported (even though you might only get approximate colour).

See here for details: https://gist.github.com/XVilka/8346728#gistcomment-2184965

Can you try using this script and check that colours work as expected?

https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh

@potuz
Copy link

potuz commented Sep 6, 2018

Ah right I didn't even know about this 24-bit-color branch of urxvt. I have only a 256-color terminal configured. I'll try to compile that branch and get back here. Thanks!

@potuz
Copy link

potuz commented Sep 15, 2018

Can you try using this script and check that colours work as expected?

https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh

Alright so I compiled rxvt with that patch and the script works as expected, but still todoman does not show colored listnames.

@potuz
Copy link

potuz commented Sep 15, 2018

My bad! I was being hit by #298 as well. Deleted the cache and all is fine now.

@dmp1ce
Copy link

dmp1ce commented Nov 28, 2018

For those wondering, like I was, the cache is probably located in ~/.cache/todoman. I deleted that directory after running vdirsyncer metasync. Then color worked for display names.

@WhyNotHugo
Copy link
Member

Gosh, looks like I kinda abandoned #299. It just needs some tests and should be done, I'll see when I have a few spare minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants