Change CTRL+C to clear the current line
This commit is contained in:
@@ -49,7 +49,10 @@ local function detect_tty() return util.is_tty() end
|
||||
local line
|
||||
if raw_mode_enabled then
|
||||
line = raw_read_line(prompt)
|
||||
if line == "__CTRL_C__" then print("\nInterrupted (Ctrl+C)"); break end
|
||||
if line == "__CTRL_C__" then
|
||||
io.write("\r\27[K")
|
||||
goto continue
|
||||
end
|
||||
else
|
||||
io.write(prompt); io.flush()
|
||||
local ok, l = pcall(io.read, "*line")
|
||||
|
||||
Reference in New Issue
Block a user