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

Python Colorama Escape Sequences on Linux compatible with Windows Wordpad

I'm using Python Colorama on a Linux system to print stdout to the terminal in color. I use the Linux 'tee' command to also capture this output to a file. When the script is done, it emails the captured text file, including the escape sequences, to…
PhilBot
  • 748
  • 18
  • 85
  • 173
0
votes
2 answers

How can I display and refresh data in the terminal without continually appending to it?

So when you console.log you're appending lines to stdout. I understand that much, but how do programs like top print to the console a continually refreshed view of data and then wipe that data when you kill it? You can see when I kill top its data…
CatDadCode
  • 58,507
  • 61
  • 212
  • 318
0
votes
1 answer

Different value JSON.stringify on IE8 with utf-8 characters

My website is using JSON.strigify() function to make json data. But I get different results between browsers with utf-8 characters. On…
manhmaluc
  • 76
  • 6
0
votes
1 answer

Disable terminal escape sequences in node.js output

I'm using Karma on node.js to run tests as part of a build script. When running the command standalone, it looks like this: However, when run as part of the build job it becomes this: TestJs: node node_modules\karma\bin\karma start…
Joey
  • 344,408
  • 85
  • 689
  • 683
0
votes
1 answer

How do i open ANS files in python?

Python 2.7.8 (with colorama) doesn't seem to load ANS files correctly. When i print an ANS file out, the output is blank. The code is is: o = open("C:\ANSI\DATA\MENU1.AMS", 'r') print(o) Am i forgetting a special character or something?
Member1221
  • 16
  • 2
0
votes
1 answer

LibGDX WrappedText but by using colors within the text (java)

I have made some code in the past to check through text to find color codes that will change the color of the text. Ex: Drawing this: Hello my name&b is john would give this as a result when drawn: Hello my name is john but "is john" would be in…
vedi0boy
  • 1,030
  • 4
  • 11
  • 32
0
votes
1 answer

How to format PHP SSH2 read() output?

I've been trying to format the output of SSH2->read() method. I tried using ANSI.php following http://phpseclib.sourceforge.net/ssh/examples.html#top My code
GP cyborg
  • 198
  • 5
  • 16
0
votes
1 answer

ANSI escape code ESC[0E doesn't work as expected

I was trying out the example code from this answer. #include #include #include void drawProgressBar(int, double); int main() { drawProgressBar(30, .25); std::this_thread::sleep_for(std::chrono::seconds(1)); …
Michael Dorst
  • 8,210
  • 11
  • 44
  • 71
0
votes
1 answer

How to change the window title of TE based on vt320?

We are developing an application based on sockets. To communicate with server we are using Terminal based on vt320. We are using some ANSI escape characters to clear screen, start print, end print, for example. .[H, .[4i, .[5i Now we are searching…
Marcelo Dias
  • 409
  • 2
  • 18
0
votes
1 answer

Ansi-escape sequences and redirection: unexpected behavior

When I run this script it works as wanted as long as I don't redirect STDOUT to a file. When I redirect STDOUT to a file, the output after the ENTER: breaks. Why doesn't the script work any more if I redirect the STDOUT to a file? #!/usr/bin/env…
sid_com
  • 24,137
  • 26
  • 96
  • 187
0
votes
1 answer

Adding an array into another array (for a Java Battleship program)

I've been at this Battleship code for weeks on and off and I really have trouble putting multi-cell ships in it. The program works fine as is, but I want to add ships that contain 2-4 cells. I've tried all that I could to no avail, if anybody can…
KTF
  • 317
  • 3
  • 7
  • 13
0
votes
1 answer

capture, get line from terminal with perl Term::Screen module or escape sequences

I use Term::Screen to put string in xterm. $scr->at(2,0)->puts("this is some stuff"); But I would like to capture, get the 2nd line (offset 0 until eol), something like that: $scr->at(2,0)->gets(); Or how can an escape sequence do that? Thanks…
user1334149
  • 161
  • 1
  • 7
0
votes
1 answer

Checking for escape character(0x1B,\033) while reading from socket

Ok, so I'm designing an Android MUD client as part of my school project. I'm having an issue, however, while implementing ANSI color parsing. I read in the data on a byte-by-byte basis. I've tried setting the character "hex" as '\033', '27', and…
Jon
  • 55
  • 9
0
votes
1 answer

How to get colored emails from crontab?

I call a Python script from crontab. The script does generates colored output using ANSI escapes but when crontab is sending the mail with the output I see the escapes instead of colors. What is happening is logic but I would like to know if it…
sorin
  • 161,544
  • 178
  • 535
  • 806
0
votes
2 answers

Determine escape sequence independent from terminal type

My app reading escape sequences from terminal in raw mode. And when it's running on xterm I got F2 like "\eOQ". But when it's running in linux tty terminal (Switching by Ctrl-Alt-F1) I got "\e[[[B". What is the correct way to determine that I got…
van
  • 249
  • 2
  • 10