0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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:
Bram Moolenaar
2018-06-12 18:05:24 +02:00
parent 07ccf7ce7f
commit d7a137fb0d
5 changed files with 44 additions and 10 deletions

View File

@@ -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);