From 7719111c571c6edd2032abf3c20186f0e205c366 Mon Sep 17 00:00:00 2001 From: nickeb96 Date: Mon, 7 May 2018 17:45:07 -0400 Subject: [PATCH] Added support for --- src/readline.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/readline.cpp b/src/readline.cpp index ab443ff..4b5aa04 100644 --- a/src/readline.cpp +++ b/src/readline.cpp @@ -70,13 +70,15 @@ public: { rl_readline_name = "sdcv"; using_history(); - const std::string histname = std::string(g_get_home_dir()) + G_DIR_SEPARATOR + ".sdcv_history"; + const gchar *hist_file_str = g_getenv("SDCV_HISTFILE"); + const std::string histname = hist_file_str ? std::string(hist_file_str) : (std::string(g_get_home_dir()) + G_DIR_SEPARATOR + ".sdcv_history"); read_history(histname.c_str()); } ~real_readline() { - const std::string histname = std::string(g_get_home_dir()) + G_DIR_SEPARATOR + ".sdcv_history"; + const gchar *hist_file_str = g_getenv("SDCV_HISTFILE"); + const std::string histname = hist_file_str ? std::string(hist_file_str) : (std::string(g_get_home_dir()) + G_DIR_SEPARATOR + ".sdcv_history"); write_history(histname.c_str()); const gchar *hist_size_str = g_getenv("SDCV_HISTSIZE"); int hist_size;