V
V
Vitteran2013-12-05 18:10:11
C++ / C#
Vitteran, 2013-12-05 18:10:11

How does the Linux console program completely clear the screen (completely including the prompt)?

How does the Linux console program completely clear the screen (completely including the prompt), as in nano, for example? That is
[email protected] ~ $ nano
, nano also opens on a blank screen, but in the same terminal window.
How to do it in C or, even better, in Go?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Monnoroch, 2013-12-05
@Vitteran

There are clear and reset commands, they do a little different, it's very easy to figure out what by trying.

J
jj_killer, 2013-12-05
@jj_killer

There is a special escape sequence: "\033[H\033[J". With it, they make a classic clear.

B
bmkobzar, 2013-12-05
@bmkobzar

ss64.com/bash/screen.html

screen top
Ctrl+A
d
screen - ls
screen -r <id>

S
Sergey, 2013-12-05
Protko @Fesor

there is also a special character \r that moves the carriage to the beginning of the line ... This is to overwrite the line with the invitation. Cleaning the screen programmatically is also there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question