Questions tagged [ansi-escape]

ANSI escape code (or escape sequences) is the method of in-band signaling to control formatting, color, and other output options on video text terminals.

To encode this formatting information, it embeds certain sequences of bytes into the text, which have to be interpreted specially, not as codes of characters. Although hardware text terminals have become increasingly rare in the 21st century, the relevance of this standard persists because most terminal emulators interpret at least some of the ANSI escape sequences in the output text. One notable exception is the win32 console component of Microsoft Windows.

655 questions
0
votes
1 answer

Difference between Active data position & Active presentation position

What is the key output difference between Active data position and Active presentation position defined separately in ECMA-48 in 4.2.5 and 4.2.6 ? I tried to move my cursor to a different coordinate in the console with Escape Sequences defined in…
Noman
  • 124
  • 2
  • 9
0
votes
1 answer

How to do a ansi color codes

The problem is that when i typed printf("\033[1;32mHello World\033[0m"); it prints something like this [1;32mHello World[0m in the console. My code is #include #include #include int main(){ …
0
votes
1 answer

Dot matrix printer printing reverse feeding (upward vertically )

I have TVS Dotmtrix printer 9 pin, using in receipt printing on (paper roll) . with Python I want printer moves 4 line upward vertically and start printing when print file send to printer i used some escape code like "\x1b\x28\x76\2\0\2\4" and…
Sunil_Gupta
  • 100
  • 1
  • 9
0
votes
1 answer

PhpStorm terminal color bug

I have upgraded my php storm to 2018.2.5 x64 and after that my terminal is showing strange characters: How to fix this issue?
TheName
  • 697
  • 1
  • 7
  • 18
0
votes
0 answers

Differentiate between Esc and other special keys on ANSI terminal

Terminal programs (notably vi and vim) can differentiate between the Esc (escape) key and other special keys like the arrow keys, having different commands for all of them. In terminal emulators, Esc seems to be encoded using only a single hex…
Lassi
  • 3,522
  • 3
  • 22
  • 34
0
votes
1 answer

Bash: ansi color when reading input from user

When using read command to get user input like the following read -p "[WARN] Text.. [Y/N]" choice Is it possible to assign an ANSI color to the warning text, like in echo command? WARN='\033[0;33m' RESET='\e[0m' echo -e "${WARN}Some warning…
revy
  • 3,945
  • 7
  • 40
  • 85
0
votes
1 answer

Tripple backslash in Bash 'echo -e' is acting strange

I have multiple Bash variables for ANSI terminal colors. One is ANSI_NOCOLOR and defined as this: ANSI_NOCOLOR="\e[0m" When I use it togather with a backslash character \ (escaped as \\ in Bash strings), I get an unexpected output. Example: echo -e…
Paebbels
  • 15,573
  • 13
  • 70
  • 139
0
votes
1 answer

Carriage return does not work with ANSI rich text

I am trying to print text repeatedly on the same line in R (windows). This works if I use the carriage return in the following way: text = c("word 1", "word 2", "word 3") for (word in text) { cat("\rText =",word) Sys.sleep(0.4) } This overrides…
Héctor van den Boorn
  • 1,218
  • 13
  • 32
0
votes
3 answers

C# - Make text blinking in console using ANSI codes

My goal is to make my text blinking in the console. I know how to do that using a timer (Link), but I want to do this using ANSI codes not like Here. I am aware of the fact, that ANSI codes work in console. Because colors, bold and underline work…
Kacper G.
  • 662
  • 8
  • 30
0
votes
0 answers

How to capture terminal screen output (with ansi color) to an image file?

I tried the following command to capture the output of a command (grep as an example) with color. But the result is shown as ^[[01;31m^[[Ka^[[m^[[K. grep --color=always a <<< a | a2ps -=book -B -q --medium=A4dj --borders=no -o out1.ps && gs…
user1424739
  • 11,937
  • 17
  • 63
  • 152
0
votes
1 answer

Parse ANSI TTY output and handle cursormoves/rewriting

I am capturing output from a TTY but it is full of ANSI escape codes, many of which move the cursor and rewrite part of the screen. I would like to be able to feed this string into a parser and have it resolve all the rewrites... I have tried a…
refeniz
  • 525
  • 1
  • 5
  • 14
0
votes
1 answer

Printing ansi to windows cmd works in IPython, but not anywhere else. Why?

I'm working on making some of my code cross platform, which means I'm battling windows issues. I'm currently having issues getting colors to display in the terminal. I mostly use pygments to work with colors. When I enter: python -c "import…
Erotemic
  • 4,806
  • 4
  • 39
  • 80
0
votes
0 answers

Strange bug where PHP will not show ANSI colors when echoed from files on OSX

I am encountering a bug where ANSI colors refuse to display when including a file. The following bash command works as expected (straight bash): echo -e "\033[31m some colored text \033[0m some white text" # Bash command displays fine The following…
mopsyd
  • 1,877
  • 3
  • 20
  • 30
0
votes
1 answer

python colored text without modifying the string

I have a python string: my_string = 'thisisjustadummystringfortestingpurposes' I want to print some regions of the string with color red, so I use ANSI escape codes: red: '\x1b[31m' black: '\x1b[0m' Then what I do is, I create a new string with…
user2261062
0
votes
1 answer

advanced printf explanation in bash

I just found this programming segment in my son's Bash file. I am quite a newbie and unable to understand the printf syntax. Can someone explain me the COMMENTED printf in the segment below?? #printf "\033[1;34m" while [ -d /proc/$PROC ]; do …
Ramesh
  • 102
  • 10