diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index 1c2631038..06af7b60b 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -484,7 +484,7 @@ static int builtin_set_list(const wchar_t *cmd, set_cmd_opts_t &opts, int argc, wcstring val; if (opts.shorten_ok && key == L"history") { history_t *history = - &history_t::history_with_name(history_session_id(env_stack_t::principal())); + &history_t::history_with_name(history_session_id(parser.vars())); for (size_t i = 1; i < history->size() && val.size() < 64; i++) { if (i > 1) val += L' '; val += expand_escape_string(history->item_at_index(i).str()); diff --git a/src/complete.cpp b/src/complete.cpp index 2b0056905..691c470ba 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -1197,7 +1197,7 @@ bool completer_t::complete_variable(const wcstring &str, size_t start_offset) { // #6288. if (env_name == L"history") { history_t *history = - &history_t::history_with_name(history_session_id(env_stack_t::principal())); + &history_t::history_with_name(history_session_id(parser->vars())); for (size_t i = 1; i < history->size() && desc.size() < 64; i++) { if (i > 1) desc += L' '; desc += expand_escape_string(history->item_at_index(i).str());