-
Notifications
You must be signed in to change notification settings - Fork 622
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
tig not showing git colors in pager mode #8
Comments
Tig is not using git's color settings in pager mode and it does not support reading the the ANSI color codes from stdin, which is probably why it looks broken. This is one reason why tig always passes the --no-color argument to git-diff(1) and git-log(1). |
ok so is .bashrc (1):
so far our only solution? |
EDIT: updated workaround to also handle file name parameters given after "git diff". |
There's a git config setting that allow you to enable colors only when git output is written to a tty/terminal. |
That's great. Except setting it to true or auto in my case didn't make a single bit of difference, tig still received ANSI sequences. |
EDIT: also include colorless "git show" in the function. haven't had time to debug why exactly piping doesn't cause colors to be auto-dropped. |
I've added support for loading git's color setting. With respect to the other issue, I think it is better resolved on [email protected] |
I recently had a similar issue when I set core.pager to tig, which was resolved by setting color.pager to no. |
@jhoffmann - This resolution worked perfectly for me. Thanks. |
Hi.
In my gitconfig I have:
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
but this breaks showing colors in tig (in pager mode). That's the example output from git diff:
^[[1;33mindex 8400b58..a9ce073 100644^[[m
^[[1;33m--- a/gitconfig^[[m
^[[1;33m+++ b/gitconfig^[[m
^[[1;35m@@ -18,19 +18,16 @@^[[m
frag = magenta bold^[[m
old = red bold^[[m
new = green bold^[[m
^[[1;32m+^[[m^[[1;32m whitespace = red reverse^[[m
[color "status"]^[[m
added = yellow^[[m
changed = green^[[m
untracked = cyan^[[m
^[[m
^[[1;31m-[color]^[[m
^[[1;31m- ui = true^[[m
^[[1;31m-[color "diff"]^[[m
^[[1;31m- whitespace = red reverse^[[m
[core]^[[m
The text was updated successfully, but these errors were encountered: