[Gambas-user] Clear console

Benoît Minisini g4mba5 at gmail.com
Fri Mar 20 21:46:43 CET 2020


Le 20/03/2020 à 20:59, André Rothe a écrit :
> private Sub Cls()
>     Shell "/usr/bin/clear" Wait
> end
> 
> Unfortunately it doesn't work within the IDE console window.
> 

It works here. Which version of Gambas do you use?

By the way, the terminals on Linux with GUI are terminal emulators.

These terminals are complex beasts that use special character sequences 
for commands like clearing the screen.

The Gambas virtual terminal (now used by the IDE console) is a VT-100 
terminal. Clearing the screen is done by issuing the sequence "\e[2J".

I think all GUI terminal emulators (on KDE, Gnome...) is VT-100 compatible.

In the past, when Unix meant a mainframe connected to a lot of possibly 
different terminals, you had to use the "ncurses" library that provides 
the needed API to manipulate any terminal type. It's still needed today, 
but it's easier to assume VT-100 compatibility.

Regards,

-- 
Benoît Minisini


More information about the User mailing list