Changeset

10877:2b015ef8cd06

util.prosodyctl.shell: Save readline history
author Kim Alvefur <zash@zash.se>
date Tue, 02 Jun 2020 09:35:07 +0200
parents 10876:c01c39a2c7a2
children 10878:b37dc3776f69
files util/prosodyctl/shell.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/prosodyctl/shell.lua	Tue Jun 02 08:41:05 2020 +0100
+++ b/util/prosodyctl/shell.lua	Tue Jun 02 09:35:07 2020 +0200
@@ -10,6 +10,10 @@
 
 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 @@
 		if not line then
 			print("");
 		end
+		if have_readline then
+			readline.save_history();
+		end
 		os.exit();
 	end
 	send_line(client, line);