aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl/shell.lua
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
commitc382e09470c10a66dc58a40e7367f28c5073f71f (patch)
tree24fe0f6525e0913adca26e35834204ab387ba084 /util/prosodyctl/shell.lua
parent50b12ee71606356d944691772859bf629fa1f9fb (diff)
downloadprosody-c382e09470c10a66dc58a40e7367f28c5073f71f.tar.gz
prosody-c382e09470c10a66dc58a40e7367f28c5073f71f.zip
util.prosodyctl.shell: Save readline history
Diffstat (limited to 'util/prosodyctl/shell.lua')
-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);