**如何在julia-app mac OS-X **中清除屏幕
在mac终端中 - clear
将清除终端屏幕。
如何在Mac OS X的julia交互式应用程序中执行相同操作?
答案 0 :(得分:5)
Ctrl + L
。julia> ; # upon typing ;, the prompt changes (in place) to: shell>
shell> clear # unix
shell> cmd /c cls # windows
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()
这是以平台和版本无关的方式工作(在Windows和Linux中测试,Julia版本0.3.12,0.4.5和0.5。+)。
答案 1 :(得分:1)
部分答案
创建一个函数clear()
来打印换行符
clear() = for i in 1:20
print("\n")
end
然后调用函数
clear()
答案 2 :(得分:1)
如果要清除交互式shell运行的屏幕,请尝试Ctrl+L
。与bash
相同。