SmallBASIC icon indicating copy to clipboard operation
SmallBASIC copied to clipboard

Como limpar a tela do terminal?

Open luizmoura1 opened this issue 11 months ago • 2 comments

Pessoal,

É possível em modo CLI (prompt de comando) apagar a tela? Tentei usar CLS dentro do script .bas, mas não funcionou. Fiquei surpreso com o poder do SmalBASIC, quando comparado a outras versões de BASIC. Obrigado! At.te,

Luiz

luizmoura1 avatar Mar 09 '25 11:03 luizmoura1

The CLI version of SmallBASIC (sbasic or sbasic.exe) supports in Linux and newer Windows versions (some win10 and win11) ANSI escape codes. I tested the following example in win11 using terminal as CLI.

' https://en.wikipedia.org/wiki/ANSI_escape_code

print "\e[31mTest1\e[0m"    ' Test1 in red

print "\e[2J"               ' Clear screen
print "\e[0;0H"             ' Cursor to 0,0 (top/left)

print "\e[31mTest2\e[0m"    ' Test2 in red, only this should be visible

Joe7M avatar Mar 10 '25 10:03 Joe7M

Obrigado! Em segunda-feira, 10 de março de 2025 às 07:29:18 BRT, Joerg Siebenmorgen @.***> escreveu:

The CLI version of SmallBASIC (sbasic or sbasic.exe) supports in Linux and newer Windows versions (some win10 and win11) ANSI escape codes. I tested the following example in win11 using terminal as CLI. ' https://en.wikipedia.org/wiki/ANSI_escape_code

print "\e[31mTest1\e[0m" ' Test1 in red

print "\e[2J" ' Clear screen print "\e[0;0H" ' Cursor to 0,0 (top/left)

print "\e[31mTest2\e[0m" ' Test2 in red, only this should be visible

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***> Joe7M left a comment (smallbasic/SmallBASIC#238) The CLI version of SmallBASIC (sbasic or sbasic.exe) supports in Linux and newer Windows versions (some win10 and win11) ANSI escape codes. I tested the following example in win11 using terminal as CLI. ' https://en.wikipedia.org/wiki/ANSI_escape_code

print "\e[31mTest1\e[0m" ' Test1 in red

print "\e[2J" ' Clear screen print "\e[0;0H" ' Cursor to 0,0 (top/left)

print "\e[31mTest2\e[0m" ' Test2 in red, only this should be visible

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

| | Não contém vírus.www.avg.com |

luizmoura1 avatar Mar 10 '25 13:03 luizmoura1