[arch-general] Escape sequences instead of colors in terminal
Hi all, I already asked this at the forums, but as no one has an answer there I hope someone here knows a solution. On a Git cheat sheet I found that I could add nice colors to Git's output, so I edited my ~/.gitconfig by adding: [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 [color "status"] added = yellow changed = green untracked = cyan When performing a git log my terminal looks like this: http://ompldr.org/vZ2t1bA (escape sequences instead of colors). The same problem appears with git diff: http://ompldr.org/vZ2t1bg However, as you can see in the second screenshot, git status and git branch look correct. This happens in urxvt, but also in xterm and the terminal screens (tty[1-6]). Do you know what's wrong? Regards, Marcel
On Dec 5, 2012 6:11 PM, "Marcel Korpel" <marcel.lists@gmail.com> wrote:
Hi all,
I already asked this at the forums, but as no one has an answer there I hope someone here knows a solution. On a Git cheat sheet I found that I could add nice colors to Git's output, so I edited my ~/.gitconfig by adding:
[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 [color "status"] added = yellow changed = green untracked = cyan
When performing a git log my terminal looks like this: http://ompldr.org/vZ2t1bA (escape sequences instead of colors). The same problem appears with git diff: http://ompldr.org/vZ2t1bg
However, as you can see in the second screenshot, git status and git branch look correct. This happens in urxvt, but also in xterm and the terminal screens (tty[1-6]).
Do you know what's wrong?
Regards, Marcel
Your pager is to blame. Assuming you're using less, you need to pass the -R option. You can add: export LESS=-R To your shell rc file.
On 5 December 2012 23:14, Dave Reisner <d@falconindy.com> wrote:
On Dec 5, 2012 6:11 PM, "Marcel Korpel" <marcel.lists@gmail.com> wrote:
Hi all,
I already asked this at the forums, but as no one has an answer there I hope someone here knows a solution. On a Git cheat sheet I found that I could add nice colors to Git's output, so I edited my ~/.gitconfig by adding:
[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 [color "status"] added = yellow changed = green untracked = cyan
When performing a git log my terminal looks like this: http://ompldr.org/vZ2t1bA (escape sequences instead of colors). The same problem appears with git diff: http://ompldr.org/vZ2t1bg
However, as you can see in the second screenshot, git status and git branch look correct. This happens in urxvt, but also in xterm and the terminal screens (tty[1-6]).
Do you know what's wrong?
Regards, Marcel
Your pager is to blame. Assuming you're using less, you need to pass the -R option. You can add:
export LESS=-R
To your shell rc file.
As far as I can tell, Git seems to be able to set the less -R option itself. But I notice it doesn’t work if the $LESS environment variable is already set. So I’d suggest manually adding -R as Dave said, or deleting the variable entirely.
On Thu, Dec 6, 2012 at 1:40 AM, Martin Panter <vadmium+al@gmail.com> wrote:
On 5 December 2012 23:14, Dave Reisner <d@falconindy.com> wrote:
Your pager is to blame. Assuming you're using less, you need to pass the -R option. You can add:
export LESS=-R
To your shell rc file.
As far as I can tell, Git seems to be able to set the less -R option itself. But I notice it doesn’t work if the $LESS environment variable is already set. So I’d suggest manually adding -R as Dave said, or deleting the variable entirely.
That was indeed the problem. I already have options -MX in my $LESS (to avoid clearing the screen), so I just added -R and it solved my problem. Thanks. Regards, Marcel
participants (3)
-
Dave Reisner
-
Marcel Korpel
-
Martin Panter