diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-06-12 20:25:52 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-06-12 20:25:52 +0200 |
commit | 493359eb3b10377d5c3524e91d911809b8ac7a76 (patch) | |
tree | 9fbef20dacb5f09982441ec052fa872943bfaa20 /src/os_win32.c | |
parent | d7a137fb0d980545dd567bee9c24cf7b9c3a2eae (diff) | |
download | vim-git-493359eb3b10377d5c3524e91d911809b8ac7a76.tar.gz |
patch 8.1.0050: $VIM_TERMINAL is also set when not in a terminal windowv8.1.0050
Problem: $VIM_TERMINAL is also set when not in a terminal window.
Solution: Pass a flag to indicate whether the job runs in a terminal.
Diffstat (limited to 'src/os_win32.c')
-rw-r--r-- | src/os_win32.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/os_win32.c b/src/os_win32.c index 3b0291e9b..f340949aa 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -5275,26 +5275,31 @@ win32_build_env(dict_T *env, garray_T *gap, int is_terminal) } } - if (is_terminal) +# if defined(FEAT_CLIENTSERVER) || defined(FEAT_TERMINAL) { -# ifdef FEAT_CLIENTSERVER +# ifdef FEAT_CLIENTSERVER char_u *servername = get_vim_var_str(VV_SEND_SERVER); size_t servername_len = STRLEN(servername); -# endif +# endif +# ifdef FEAT_TERMINAL char_u *version = get_vim_var_str(VV_VERSION); size_t version_len = STRLEN(version); +# endif // size of "VIM_SERVERNAME=" and value, // plus "VIM_TERMINAL=" and value, // plus two terminating NULs size_t n = 0 -# ifdef FEAT_CLIENTSERVER +# ifdef FEAT_CLIENTSERVER + 15 + servername_len -# endif - + 13 + version_len + 2; +# endif +# ifdef FEAT_TERMINAL + + 13 + version_len + 2 +# endif + ; if (ga_grow(gap, (int)n) == OK) { -# ifdef FEAT_CLIENTSERVER +# ifdef FEAT_CLIENTSERVER for (n = 0; n < 15; n++) *((WCHAR*)gap->ga_data + gap->ga_len++) = (WCHAR)"VIM_SERVERNAME="[n]; @@ -5302,14 +5307,19 @@ win32_build_env(dict_T *env, garray_T *gap, int is_terminal) *((WCHAR*)gap->ga_data + gap->ga_len++) = (WCHAR)servername[n]; *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0'; -# endif - for (n = 0; n < 13; n++) - *((WCHAR*)gap->ga_data + gap->ga_len++) = - (WCHAR)"VIM_TERMINAL="[n]; - for (n = 0; n < version_len; n++) - *((WCHAR*)gap->ga_data + gap->ga_len++) = - (WCHAR)version[n]; - *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0'; +# endif +# ifdef FEAT_TERMINAL + if (is_terminal) + { + for (n = 0; n < 13; n++) + *((WCHAR*)gap->ga_data + gap->ga_len++) = + (WCHAR)"VIM_TERMINAL="[n]; + for (n = 0; n < version_len; n++) + *((WCHAR*)gap->ga_data + gap->ga_len++) = + (WCHAR)version[n]; + *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0'; + } +# endif } } } |