Posts: 1,308
BitJam
Joined: 31 Aug 2009
#1
Sometimes
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://en.wikipedia.org/wiki/ANSI_escape_code"
linktext was:"ANSI escape sequences"
====================================
are used to color text on the command line. If your editor or pager doesn't handle these properly then instead of seeing colored text you see something like:

Code: Select all

^[[9;23H^[[1;35m \-/
^[[11;23H^[[1;36m >x<
^[[13;23H^[[1;37m :@:
^[[15;23H^[[1;34m !"!
^[[17;23H^[[1;33m .o.
^[[19;23H^[[1;32m |O|
^[[21;23H^[[1;35m \-/
You can see the colors instead of the escape sequences if you use the"cat" command but the"less" command shows you the ugly escape sequences. You can fix this by adding the following line to your .bashrc file:

Code: Select all

LESS="-R"
To get this to work immediately you will have to source your .bashrc file:

Code: Select all

$ source ~/.bashrc
You can edit files that contain ANSI escape sequences by using the Vim editor with the
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.vim.org/scripts/script.php?script_id=302"
linktext was:"AnsiEsc"
====================================
script. The command":AnsiEsc" will toggle the appearance of the escape sequences.