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

How can I delete characters in stdout by programming?

I want to emulate backspace in programming and implemented as below. // del.cpp #include using namespace std; int main() { cout << "123456"; cout << "\b\b\b" /* backspace key */<< '\x7f' /* DEL key */ << '\x7f' << '\x7f'; …
Yantao Xie
  • 12,300
  • 15
  • 49
  • 79
-1
votes
1 answer

setting stdin to nonblocking affects ansi control sequence output

I am trying to draw a black box on terminal at top left corner with stdin nonblocking mode turned on. The black box has size 10 cols and 5 rows. I am using the following code to draw it. #include #include #include…
Austin
  • 9
  • 2
-1
votes
1 answer

resizable box-drawing in the terminal

I'm currently trying to do pretty cli apps, my goal is to make a box that makes the whole outline of the terminal. What I currently do: Grab the size of the terminal Draw the top line : top-left corner + (width - 2) * top edge + top-right…
-1
votes
2 answers

Is it possible to make a line of script (print("\033c")) added by default to the beginning of Python files in VSCode?

In order to remove file path displayed in Terminal of VsCode I use print("\033c") at the first line of each of my Python script files. Is it possible to make this line be the first line of each Python script file by default?
Etemon
  • 53
  • 2
  • 11
-1
votes
1 answer

How does this Python code for printing out a multiplication table work? How do I program an addition table in Python?

Expected output: no return value, prints out addition and multiplication tables for values 1 to 10 I am very new to Python and really struggling with this one. I have the multiplication table finished, but was helped by a tutor. I'd like an…
-1
votes
1 answer

Unable to print Escape Seqences with Python in Visual Studio (Win 10, Python 3.9, VS 2019)

My Issue I'm a begginer with Python, and I've been working on code in Visual Studio in which I want to be able use ANSI Escape Sequences to format my output on the terminal console. I'm using Python 3.9, Visual Studio 2019 (Community Edition) and…
Runsva
  • 365
  • 1
  • 7
-1
votes
1 answer

Escape Sequences for EXE

I have some escape sequences in my config on my Linux machine that work fine, but for some reason, they are completely ignored in the Windows port of Pianobar. What's interesting is it doesn't print the escape sequences to the display - it just…
-1
votes
2 answers

Romanian Hex Escape Codes?

I am translating stuff from an application to Romanian (already did German), and I need hex escape codes for ă â ș ț î. Like the German "ü" is \x81, are there hex escape codes for those Romanian characters? I couldn't find any after 30 minutes of…
Kerb Space
  • 11
  • 2
-1
votes
2 answers

Function to check if a string is an ANSI escape sequence?

I need a C++ function (or object) able to tell me if a certain string is an ANSI escape sequence. So, if I have for example: std::string ansi = "\033[0m"; I would need something like this: is_escape_char( ansi ) which returns false or true if the…
Gianluca Bianco
  • 656
  • 2
  • 11
-1
votes
2 answers

Why do newlines break ANSI cursors?

In a contrived example, if I have the following: sup="$(printf "\e[s" > /dev/tty; printf "one" > /dev/tty; printf "\e[u\e[Jtwo" > /dev/tty)" The output will successfully erase one leaving only: two However, if I use echo "one" to print a newline…
balupton
  • 47,113
  • 32
  • 131
  • 182
-1
votes
1 answer

ANSI escape sequences breaking when called by a script

I've been using a program called fzf for selecting things in scripts for some time but on several occasions I have found myself trying to run these scripts on systems which does not have this program installed. To remedy this I wrote a mini clone…
scorch855
  • 302
  • 1
  • 9
-1
votes
1 answer

Reading cursor position in a Java console application

I want to determine cursor position in a Java console application. This can be achieved by the following ANSI code sequence: ESC[6n If I send that ANSI escape command I get the answer, but I can not retrieve it in Java. This is what I have…
M.E.
  • 4,955
  • 4
  • 49
  • 128
-1
votes
1 answer

Comparing ANSI-Colored Strings in Java

I am currently Making a battleship This is an image of the game board: For the tests we are looking at tile (1,1) Which is the solid blue tile in the top right. The Solid Blue have the background and foreground colors identical, containing a hidden…
-1
votes
1 answer

ANSI sequence to change terminal name

I use a bash script (konsole-name.sh) to change a terminal name, like this: #!/usr/bin/bash echo -en "\e]30;$1\a" and I wanted to use the same method from a perl script that I use to check the GPU temperature, so that it updates periodically the…
alessandro
  • 3,838
  • 8
  • 40
  • 59
-1
votes
1 answer

'watch' is not interpreting the implicit 'reset' color code `^[m`

It appears that watch is not interpret the implicit 'reset' color code ^[m. It does interpret the explicit code ^[0m. Does anyone know how to fix this? Or does it sound like a bug and I need to contact the maintainers of watch? Why I'm asking: I'm…
dthor
  • 1,749
  • 1
  • 18
  • 45
1 2 3
43
44