mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-14 17:07:44 +00:00
Don't default term size if it is too small
This is unlikely to achieve anything sensible. Fixes #6980.
This commit is contained in:
parent
ec74c739c8
commit
81ded4c0ab
1 changed files with 1 additions and 13 deletions
|
@ -1764,8 +1764,7 @@ void common_handle_winch(int signal) {
|
||||||
s_termsize_valid = false;
|
s_termsize_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Validate the new terminal size. Fallback to the env vars if necessary. Ensure the values are
|
/// Validate the new terminal size. Fallback to the env vars if necessary.
|
||||||
/// sane and if not fallback to a default of 80x24.
|
|
||||||
static void validate_new_termsize(struct winsize *new_termsize, const environment_t &vars) {
|
static void validate_new_termsize(struct winsize *new_termsize, const environment_t &vars) {
|
||||||
if (new_termsize->ws_col == 0 || new_termsize->ws_row == 0) {
|
if (new_termsize->ws_col == 0 || new_termsize->ws_row == 0) {
|
||||||
#ifdef HAVE_WINSIZE
|
#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.
|
/// Export the new terminal size as env vars and to the kernel if possible.
|
||||||
|
|
Loading…
Reference in a new issue