env_stack_t::set_termsize to operate on self, not global stack

This commit is contained in:
ridiculousfish 2020-06-07 12:57:34 -07:00
parent 064324984b
commit 229ead9b8a

View File

@ -1220,12 +1220,11 @@ void env_stack_t::set_last_statuses(statuses_t s) {
/// defaults. They will be updated later by the `get_current_winsize()` function if they need to be
/// adjusted.
void env_stack_t::set_termsize() {
auto &vars = env_stack_t::globals();
auto cols = get(L"COLUMNS");
if (cols.missing_or_empty()) vars.set_one(L"COLUMNS", ENV_GLOBAL, DFLT_TERM_COL_STR);
if (cols.missing_or_empty()) set_one(L"COLUMNS", ENV_GLOBAL, DFLT_TERM_COL_STR);
auto rows = get(L"LINES");
if (rows.missing_or_empty()) vars.set_one(L"LINES", ENV_GLOBAL, DFLT_TERM_ROW_STR);
if (rows.missing_or_empty()) set_one(L"LINES", ENV_GLOBAL, DFLT_TERM_ROW_STR);
}
/// Update the PWD variable directory from the result of getcwd().