:terminal so the child environment is set via set_child_environment() / set_default_child_environment() (e.g. :!ls, :terminal, or a job that inherits Vim’s tty size vars).src/os_unix.c: every setenv() / putenv() call discards its return value. If any call fails (typically ENOMEM), the child is still launched with a missing/stale TERM / ROWS / LINES / COLUMNS / COLORS / VIM_TERMINAL / VIM_SERVERNAME.src/os_unix.c):#ifdef HAVE_SETENV setenv("TERM", term, 1); ... setenv("ROWS", buf, 1); setenv("LINES", buf, 1); setenv("COLUMNS", buf, 1); ... /* COLORS / VIM_TERMINAL / VIM_SERVERNAME similarly unchecked */ #else /* putenv() fallback also ignores return values */ #endif
Callers include the default shell path and job/terminal startup in the same file (e.g. around the mch_call_shell / job-init paths that invoke set_child_environment()).
If setenv() / putenv() fails, Vim should surface an error (or otherwise abort the spawn path) instead of silently starting the child with an incomplete or stale terminal environment.
9.2.0838
Operating system: Linux
Terminal: any
Value of $TERM: any
Shell: any
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()