aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-02 09:35:07 +0200
committerKim Alvefur <zash@zash.se>2020-06-02 09:35:07 +0200
commit6264bd48c14ae1d1ba5f22d90abf3c9842279f9c (patch)
tree24fe0f6525e0913adca26e35834204ab387ba084 /util
parent9aebf2d7dbc1ba31e4def08374382099a57a693b (diff)
downloadprosody-6264bd48c14ae1d1ba5f22d90abf3c9842279f9c.tar.gz
prosody-6264bd48c14ae1d1ba5f22d90abf3c9842279f9c.zip
util.prosodyctl.shell: Save readline history
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/shell.lua7
1 files changed, 7 insertions, 0 deletions
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);