Supervisor: git diff terminal colors not working

Created on 2 Feb 2018  路  2Comments  路  Source: home-assistant/supervisor

I use git for version controlling my configuration. A git status shows colorized output for changed files. But when I use a git diff .gitignore the colors are not showing. Instead I get to see the literal escape codes.

Using hassio latest, ssh with different ssh clients from different machines.

Please note, terminal colors are working in general, but not with git diff.

Most helpful comment

I ran into this just now and investigated a bit. The issue is that git by default uses less to page the output of its commands, and less on Hass.io is a stripped-down version provided by busybox that does not have color support.

Two workarounds:

  1. Disable paging in git commands (git config --global core.pager cat)

OR

  1. Install a more full featured less (apk --no-cache add less)

It would be nice if a future version of Hass.io could ship with a full version of less so that this workaround is not necessary.

All 2 comments

I ran into this just now and investigated a bit. The issue is that git by default uses less to page the output of its commands, and less on Hass.io is a stripped-down version provided by busybox that does not have color support.

Two workarounds:

  1. Disable paging in git commands (git config --global core.pager cat)

OR

  1. Install a more full featured less (apk --no-cache add less)

It would be nice if a future version of Hass.io could ship with a full version of less so that this workaround is not necessary.

This issue was moved by frenck to home-assistant/hassio-addons#410.

Was this page helpful?
0 / 5 - 0 ratings