diff --git a/NEWS b/NEWS index 74553468d..c328669d1 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ subject to change and not guaranteed to be compatible with the later release. USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE! +* Store interactive history in `$XDG_CACHE_HOME/nmcli-history` instead of + `~/.nmcli-history` * Add new ipv4.link-local=fallback to set an IPv4 link-local address when no other IPv4 is set. * Remove support for building with Autotools diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index 971bed9f0..5cbc4c10f 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -6913,7 +6913,7 @@ nmcli_editor_tab_completion(const char *text, int start, int end) return match_array; } -#define NMCLI_EDITOR_HISTORY ".nmcli-history" +#define NMCLI_EDITOR_HISTORY "nmcli-history" static void load_history_cmds(const char *uuid) @@ -6925,7 +6925,7 @@ load_history_cmds(const char *uuid) size_t i; GError *err = NULL; - filename = g_build_filename(g_get_home_dir(), NMCLI_EDITOR_HISTORY, NULL); + filename = g_build_filename(g_get_user_cache_dir(), NMCLI_EDITOR_HISTORY, NULL); kf = g_key_file_new(); if (!g_key_file_load_from_file(kf, filename, G_KEY_FILE_KEEP_COMMENTS, &err)) { if (g_error_matches(err, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE)) @@ -6961,7 +6961,7 @@ save_history_cmds(const char *uuid) if (!hist) return; - filename = g_build_filename(g_get_home_dir(), NMCLI_EDITOR_HISTORY, NULL); + filename = g_build_filename(g_get_user_cache_dir(), NMCLI_EDITOR_HISTORY, NULL); kf = g_key_file_new();