How to Initialize the Console in Julia
Method
In the console, pressing Ctrl + L appears to clear the console completely, but in some environments, it does not actually reset but rather scrolls the window as if it were pushed up. To cleanly remove or not rely on keyboard input, printing ASCII character \033c
can be used1 2.
print("\033c")
Also, printing \007
will play a notification sound3. It’s surprisingly useful when you want to hear the end of a simple simulation or similar event through sound.
println("\007")
Environment
- OS: Windows
- julia: v1.7.3