2

如何在 Lua 交互式解释器中重复上一条命令?按向上键会导致:

^[[A
4

1 回答 1

8

The up arrow works fine for me in Lua 5.1 and 5.2 under Windows and Debian; if it's not working for you then you should be able to add the functionality to any application using rlwrap. I just tested it with LuaJIT on Debian, which has no readline support, and it worked perfectly.

If you don't want to use rlwrap, you'll probably need to recompile Lua with LUA_USE_READLINE enabled in luaconf.h.

于 2012-11-07T05:45:44.653 回答