# Problems with \\u001b\[31m ANSI colour codes

**URL:** <https://forum.ansible.com/t/problems-with-u001b-31m-ansi-colour-codes/32629>\
**Category:** Ansible Project\
**Created:** [April 8, 2020, 2:56am UTC](https://forum.ansible.com/t/problems-with-u001b-31m-ansi-colour-codes/32629 "2020-04-08T02:56:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gobi](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@Gobi](https://forum.ansible.com/u/Gobi)\
**Post date:** [April 8, 2020, 2:56am UTC](https://forum.ansible.com/t/problems-with-u001b-31m-ansi-colour-codes/32629/1 "2020-04-08T02:56:47Z")

</div>

Ansible Version:  
ansible 2.9.4  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u'/home/gobi/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']  
ansible python module location = /home/gobi/.local/lib/python2.7/site-packages/ansible  
executable location = /home/gobi/.local/bin/ansible  
python version = 2.7.17 (default, Nov 7 2019, 10:07:09) [GCC 7.4.0]

COMPONENT NAME  
debug

Summary:  
While running git status or any other commands, the deleted and marked files are shown in red or any other colours. When trying to store the results of the commands in a register and print the values using debug module \u001b[31m or any other ANSI code will append to the result. The debug will print the result in default green colour, maybe this is the reason for this issue.  
How can be \u001b[31m these are avoided?

In my terminal normal git status command:  
image

using

shell: git status  
register: temp\_reg  
debug: msg="{{temp\_reg.stdout\_lines}}  
image

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [April 9, 2020, 10:51am UTC](https://forum.ansible.com/t/problems-with-u001b-31m-ansi-colour-codes/32629/2 "2020-04-09T10:51:29Z")

</div>

I think your problem is that you have colors enabled in the non-interactive mode of your shell,  
which doesn't make sense all.

Check your shell configuration files, e.g. ~/.bashrc has usually a condition for non-interactive  
mode:

# If not running interactively, don't do anything  
case $- in  
&nbsp;&nbsp;&nbsp;&nbsp;\*i\*) ;;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*) return;;  
esac

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
