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
2 answers

Help scrolling and number of lines in a shell

I'm programming in C and I need to know the number of lines of stdin. After a certain number of lines, I also need to scroll up one line...I used an ANSI escape code (033[1S), but I lose the content of the line scrolled and I don't wanna this. EDIT:…
ubuntiano
  • 89
  • 1
  • 1
  • 6
0
votes
1 answer

How to translate vim keycode to byte sequence that triggers it?

When using the :map command, you can specify key sequences, for example which means Ctrl+A, and it is triggered by '\x01' (represented as '^A') However, there are combinations not possible to send by some Terminal emulators natively, like the…
hl037_
  • 3,520
  • 1
  • 27
  • 58
0
votes
1 answer

How to capture escape sequences sent by terminal?

How would one capture the escape sequences as they are sent by a terminal application (say Konsole for example) ? For example, if you hit PgDown, what is sent to the virtual console ? I would like to record the byte stream sent to the virtual…
hl037_
  • 3,520
  • 1
  • 27
  • 58
0
votes
0 answers

Escape sequence \u001b[2D and \u001b[40C

I came across this piece of text in my console output: I:\u001b[2DA_O_T:\u001b[40C = -0.0 I know that I: and A_O_T: as well as = -0.0 is normal output so I conclude that \u001b[2D and \u001b[40C are escape sequences. But I couldnt figure out what…
Fuzzyma
  • 7,619
  • 6
  • 28
  • 60
0
votes
0 answers

How to translate ANSI to string in nodejs?

I am using nodejs in my application and need to deal with ANSI character. I am looking for a way to translate a ANSI to a normal string. For example, I get this ANSI characters: db[3G[Jdb[5G then translate should be: `[3G` -> go to the 3rd column…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
0
votes
2 answers

ANSI escape characters does not appear the way they should on Eclipse console

I have a Scala project and I use Scala-Eclipse-Plugin along with sbt. So far so good. But the problem is that sbt writes some ANSI escape sequences to the output (I might be wrong about this?).They appear pretty well when I invoke sbt from shell but…
Ashkan Kh. Nazary
  • 21,844
  • 13
  • 44
  • 68
0
votes
0 answers

ANSI colour codes don't work

I'm trying to use ANSI colour codes to output coloured text in python, but this is what happens: print("\033[1;32;40mBright Green") Outputted: [1;32;40mBright Green I am running python 3.5.2 on macOS Sierra. Is my code missing something, or can I…
Tom
  • 19
  • 1
  • 3
0
votes
1 answer

AnsiColor Plugin does not work when ansi string is loaded with getenv

Setting color from python string works like a charm. Here is a working snippet from my python script: line = "All Tests OK." print('\033[31m \033[1m' + line + '\033[0m'); This results in a colored Jenkins Console output like this: All Tests…
domih
  • 1,440
  • 17
  • 19
0
votes
1 answer

BASH control sequences parser or regex?

I've stumbled across this topic because I'm developing a console app, currently on a Windows machine using Cygwin to run it (but it will have to run in Linux BASH too at some stage). Initially all I want to do is apply colour, so I've found out…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
0
votes
2 answers

Support for ANSI escape sequence cursor moving

I'm making a simple ASCII animation, and I need the ability to place the cursor at an arbitrary point in the console screen. While searching, I found this blog that shows this can be achieved by doing: (print (str (char 27) "[2J")) ; clear…
Carcigenicate
  • 43,494
  • 9
  • 68
  • 117
0
votes
0 answers

UWP + SSH.Net c# how to output ANSI string from shellstream to textbox/richeditbox with correct colouring

I'm using ssh.net in a UWP program. I am having diffixulty getting it to output a ANSI string to a richeditbox with the correct colouring as you would see using the likes of putty. The output looks like [3;J[H[2J…
Steve Fitzsimons
  • 3,754
  • 7
  • 27
  • 66
0
votes
1 answer

Python print on lines that are not visible anymore on the terminal with ANSI escape codes

I try to replace the text printed on a given line by another. For that, I have been using ANSI escape codes. My problem is when the line to be replaced is not visible on the screen anymore (but still visible by scrolling up the window) I don't seem…
Thomas Leonard
  • 1,047
  • 11
  • 25
0
votes
1 answer

Where does PuTTY and VT100 start row and column?

I'm trying to figure out how the PuTTY terminal numbers its rows and columns. Does it start from 0,0 or 1,1? I'm using VT100 to set the cursor and it's important to send the right count. I want to force the cursor location like this: ESC[1,0f and I…
visc
  • 4,794
  • 6
  • 32
  • 58
0
votes
0 answers

Bash echo end up on input line

I'm using the escape sequence \u001B[6n to find the current terminal cursor location in linux. However, when I run the command echo -e '\u001B[6n', the response is seemingly written as input to the terminal? I'm trying to use this command from…
Felix ZY
  • 674
  • 6
  • 14
0
votes
1 answer

Terminal ANSI escape codes don't work

When I was using Arcanist and landing some code I found out that my terminal does not escape the colors. The [1;32m9912da1[m is supposed 32m9912da1 or something similar. Is this a problem with my terminal? Other people at my work don't…