forked from aniani/vim
patch 8.1.0049: shell cannot tell running in a terminal window
Problem: Shell cannot tell running in a terminal window. Solution: Add the VIM_TERMINAL environment variable. (Christian Brabandt)
This commit is contained in:
@@ -4169,6 +4169,7 @@ set_child_environment(long rows, long columns, char *term)
|
||||
static char envbuf_Lines[20];
|
||||
static char envbuf_Columns[20];
|
||||
static char envbuf_Colors[20];
|
||||
static char envbuf_Version[20];
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
static char envbuf_Servername[60];
|
||||
# endif
|
||||
@@ -4189,6 +4190,8 @@ set_child_environment(long rows, long columns, char *term)
|
||||
setenv("COLUMNS", (char *)envbuf, 1);
|
||||
sprintf((char *)envbuf, "%ld", colors);
|
||||
setenv("COLORS", (char *)envbuf, 1);
|
||||
sprintf((char *)envbuf, "%ld", get_vim_var_nr(VV_VERSION));
|
||||
setenv("VIM_TERMINAL", (char *)envbuf, 1);
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
setenv("VIM_SERVERNAME", serverName == NULL ? "" : (char *)serverName, 1);
|
||||
# endif
|
||||
@@ -4209,6 +4212,9 @@ set_child_environment(long rows, long columns, char *term)
|
||||
putenv(envbuf_Columns);
|
||||
vim_snprintf(envbuf_Colors, sizeof(envbuf_Colors), "COLORS=%ld", colors);
|
||||
putenv(envbuf_Colors);
|
||||
vim_snprintf(envbuf_Version, sizeof(envbuf_Version), "VIM_TERMINAL=%ld",
|
||||
get_vim_var_nr(VV_VERSION));
|
||||
putenv(envbuf_Version);
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
vim_snprintf(envbuf_Servername, sizeof(envbuf_Servername),
|
||||
"VIM_SERVERNAME=%s", serverName == NULL ? "" : (char *)serverName);
|
||||
|
Reference in New Issue
Block a user