From 81ded4c0ab64727ba983d74d0e5845076f64f147 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 7 May 2020 17:39:01 +0200 Subject: [PATCH] Don't default term size if it is too small This is unlikely to achieve anything sensible. Fixes #6980. --- src/common.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/common.cpp b/src/common.cpp index d39012065..8f74174ea 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1764,8 +1764,7 @@ void common_handle_winch(int signal) { s_termsize_valid = false; } -/// Validate the new terminal size. Fallback to the env vars if necessary. Ensure the values are -/// sane and if not fallback to a default of 80x24. +/// Validate the new terminal size. Fallback to the env vars if necessary. static void validate_new_termsize(struct winsize *new_termsize, const environment_t &vars) { if (new_termsize->ws_col == 0 || new_termsize->ws_row == 0) { #ifdef HAVE_WINSIZE @@ -1791,17 +1790,6 @@ static void validate_new_termsize(struct winsize *new_termsize, const environmen } } } - - if (new_termsize->ws_col < MIN_TERM_COL || new_termsize->ws_row < MIN_TERM_ROW) { - // Also highly hackisk. - if (is_main_thread() && parser_t::principal_parser().is_interactive()) { - FLOGF(warning, - _(L"Current terminal parameters set terminal size to unreasonable value.")); - FLOGF(warning, _(L"Defaulting terminal size to 80x24.")); - } - new_termsize->ws_col = DFLT_TERM_COL; - new_termsize->ws_row = DFLT_TERM_ROW; - } } /// Export the new terminal size as env vars and to the kernel if possible.