Skip to content

Como limpar a tela do terminal? #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
luizmoura1 opened this issue Mar 9, 2025 · 2 comments
Open

Como limpar a tela do terminal? #238

luizmoura1 opened this issue Mar 9, 2025 · 2 comments

Comments

@luizmoura1
Copy link

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

@Joe7M
Copy link
Contributor

Joe7M commented Mar 10, 2025

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

@luizmoura1
Copy link
Author

luizmoura1 commented Mar 10, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants