How do I clear the console in a Lua Program

前端 未结 4 966
梦如初夏
梦如初夏 2021-02-06 03:11

I\'m making my first Lua program with the console, and I need to find out how to remove all the text in the console without just appending a ton of \\n\'s.

4条回答
  •  说谎
    说谎 (楼主)
    2021-02-06 03:20

    You can use os.execute().

    On Windows:

    os.execute("cls")
    

    On Unix:

    os.execute("clear")
    

提交回复
热议问题