**如何在julia-app mac OS-X中清除屏幕**
在mac终端 - clear
将清除终端屏幕.
如何在Mac OS X中的julia交互式应用程序中执行相同的操作?
Ctrl + L
.julia> ; # upon typing ;, the prompt changes (in place) to: shell>
shell> clear # unix
shell> cmd /c cls # windows
Run Code Online (Sandbox Code Playgroud)
run
功能:julia> ? # upon typing ?, the prompt changes (in place) to: help>
help?> run
INFO: Loading help data...
Base.run(command)
Run a command object, constructed with backticks. Throws an error
if anything goes wrong, including the process exiting with a non-
zero status.
julia> using Compat: @static, is_unix # `Pkg.add("Compat")` if not installed.
julia> clear() = run(@static is_unix() ? `clear` : `cmd /c cls`)
clear (generic function with 1 method)
julia> clear()
Run Code Online (Sandbox Code Playgroud)
这适用于平台和版本无关的方式(在Windows和Linux中测试,Julia版本0.3.12,0.4.5和0.5.+).