Questions tagged [ansi]

Many computer terminals and terminal emulators support colour and cursor control through a system of escape sequences. One such standard is commonly referred to as ANSI Colour.

In computing, ANSI escape codes (or escape sequences) are a method using in-band signaling to control the formatting, color, and other output options on video text terminals. To encode this formatting information, certain sequences of bytes are embedded into the text, which the terminal looks for and interprets as commands, not as character codes.

Sources:

12 questions
39
votes
4 answers

Saving output of a grep into a file with colors

I need to save the result of a grep command into a file, but I also want the output file to be formatted and keep the colors just like in the terminal. Is there a way to do that? Maybe make grep save to a some kind of markup language? If it is not…
18
votes
1 answer

How to print the output of tree to pdf without losing the color?

I use the following command to print a directory structure to a file: tree -h somepath/ > tree_of_somepath.txt tree gives a nice colorized output on the terminal, but as expected this cannot be redirected to a text file. I would like to print the…
Bruni
  • 11,099
9
votes
4 answers

How to read ANSI encoded files in the right way?

I have some files that Ubuntu can't read it ( ANSI encoding ) but Windows can read it well. When I open it in gedit or notepad++ it seems like this : Êã ÇáÊÍæíá áÜÜ How can I make Ubuntu read ANSI encoded files well?
Emad Saeed
  • 93
  • 1
  • 1
  • 3
7
votes
1 answer

Configure xfce4-terminal to recognize ANSI OSC 52 escape sequences to control the clipboard

tmux can put text into the system clipboard using ANSI OSC (Operating System Control) 52 escape sequences, but the terminal emulator needs to recognize them. xfce4-terminal, out-of-the-box doesn't seem to recognize them. Would anybody know how to…
3
votes
1 answer

vim cursor color change only applied upon movement

In my .vimrc I have the following (based upon a tip on the vim Wikia): if &term =~ "xterm\\|rxvt" " use an red cursor in insert mode let &t_SI = "\]12;red\x7" " use an orange-ish cursor otherwise let &t_EI = "\]12;\#FFA560\x7" …
Chan-Ho Suh
  • 7,582
  • 4
  • 43
  • 74
2
votes
1 answer

Transparent palette in gnome-terminal

I use a transparent background in gnome-terminal. For work, I often need to SSH into Windows machines. OpenSSH dutifully sends ANSI background colors, which results in a... less than ideal experience when mixed with the terminal's transparency. An…
Xyene
  • 123
2
votes
1 answer

How to activate support for ANSI escape in terminal?

The ri tool of Ruby for the documentation offers the possibility to output ANSI escape sequences, but the terminal has to support it. How is it possible to activate support for ANSI escape sequences in the Gnome terminal of Ubuntu? In a way that…
1
vote
0 answers

How to fix HOME and END buttons in Bash with ANSI prompt?

In bash, whenever I have a prompt with ANSI color codes, it messes up the HOME and END functionality. Is there an obvious fix for this? To re-create: PS1="\e[0;33m\u@\e[m $ " echo "This is a very long sentence to demonstrate what im talking…
1
vote
0 answers

Why temp txt files are created in ANSI?

I have a big log file and i need to cut a part of it and paste it in the end of the same file... so i created a script that looks for the chunks of code i need (sed) create a temp file ,paste it , then go to original file and delete that same…
0
votes
1 answer

Strip ANSI sequences from string through bash-python code

I try to use bash to strip ANSI color escape sequences from a string without success. I tried already some regex-based code. #!/bin/bash Blue='\033[0;34m' # Blue Clear='\033[0m' # Text Reset removeColors (){ local…
Bruno Lobo
  • 301
  • 1
  • 5
  • 15
0
votes
0 answers

How does one remove all ANSI exit codes/non-ascii characters from a text file (or: how does one make ANSIescape work in Sublime)

I've tried dang near every sed command I could concoct, a bunch I found on here while searching for hints, and a few other random ideas, and I just can't figure it out. As some background, I've been using this script for a while now to record…
0
votes
0 answers

Display .TXT files in a different font in CLI

I am into BBSing in 2020. Bulletin Boards use ANSI graphics, which arent displayed correctly in current terminals... I use 'iconv' to change cp437 to utf8 and display .ANS files correctly. However, I am getting into Amiga ASCII art. This art is just…