From 6264bd48c14ae1d1ba5f22d90abf3c9842279f9c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 2 Jun 2020 09:35:07 +0200 Subject: util.prosodyctl.shell: Save readline history --- util/prosodyctl/shell.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/prosodyctl/shell.lua b/util/prosodyctl/shell.lua index bbf0c83a..3e98540f 100644 --- a/util/prosodyctl/shell.lua +++ b/util/prosodyctl/shell.lua @@ -10,6 +10,10 @@ local adminstream = require "util.adminstream"; if have_readline then readline.set_readline_name("prosody"); + readline.set_options({ + histfile = path.join(prosody.paths.data, ".shell_history"); + ignoredups = true; + }); end local function read_line() @@ -31,6 +35,9 @@ local function repl(client) if not line then print(""); end + if have_readline then + readline.save_history(); + end os.exit(); end send_line(client, line); -- cgit v1.2.3