mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:28:58 +08:00
Fix crash with empty $TERM
``` ~ $ set -e TERM; fish Assertion failed: (!is_missing), function c_str, file src/env.cpp, line 690. fish: 'fish' terminated by signal SIGABRT (Abort) ```
This commit is contained in:
parent
eb834f47ef
commit
ecf4517ffe
|
@ -464,8 +464,13 @@ int input_init() {
|
|||
int err_ret;
|
||||
if (setupterm(NULL, STDOUT_FILENO, &err_ret) == ERR) {
|
||||
env_var_t term = env_get_string(L"TERM");
|
||||
debug(0, _(L"Your TERM value of '%ls' is not valid"), term.c_str());
|
||||
debug(0, _(L"Check that your terminal type is supported on this system"));
|
||||
if (term.missing_or_empty()) {
|
||||
debug(0, _(L"Your TERM is unset or empty."));
|
||||
} else {
|
||||
debug(0, _(L"Your TERM value of '%ls' is not valid"), term.c_str());
|
||||
debug(0, _(L"Check that your terminal type is supported on this system"));
|
||||
}
|
||||
|
||||
env_set(L"TERM", DEFAULT_TERM, ENV_GLOBAL | ENV_EXPORT);
|
||||
if (setupterm(NULL, STDOUT_FILENO, &err_ret) == ERR) {
|
||||
debug(0, _(L"Unable to setup terminal using your TERM or the '%ls' fallback"),
|
||||
|
|
Loading…
Reference in New Issue
Block a user