Compare commits

...

9 Commits

Author SHA1 Message Date
d41babef89 patch 8.0.1019: pasting in virtual edit happens in the wrong place
Problem:    Pasting in virtual edit happens in the wrong place.
Solution:   Do not adjust coladd when after the end of the line (closes #2015)
2017-08-30 17:01:35 +02:00
4ad3b2b588 patch 8.0.1018: warnings from 64-bit compiler
Problem:    Warnings from 64-bit compiler. (Christian Brabandt)
Solution:   Add type casts.
2017-08-30 15:57:33 +02:00
dde6034111 patch 8.0.1017: test for MS-Windows $HOME always passes
Problem:    Test for MS-Windows $HOME always passes.
Solution:   Rename the test function.  Make the test pass.
2017-08-30 14:55:42 +02:00
f3af54eeb1 patch 8.0.1016: gnome terminal echoes t_RC
Problem:    Gnome terminal echoes t_RC.
Solution:   Detect Gnome terminal by the version string.  Add v: variables for
            all the term responses.
2017-08-30 14:53:06 +02:00
97a80e440a patch 8.0.1015: missing update to terminal test
Problem:    Missing update to terminal test.
Solution:   Add the changes to the test.
2017-08-30 13:31:49 +02:00
b47a2597e6 patch 8.0.1014: old compiler doesn't know uint32_t
Problem:    Old compiler doesn't know uint32_t. Warning for using NULL instead
            of NUL.
Solution:   Use UINT32_T.  Use NUL instead of NULL.
2017-08-30 13:22:28 +02:00
e561a7e2fa patch 8.0.1013: terminal window behaves different from a buffer with changes
Problem:    A terminal window with a running job behaves different from a
            window containing a changed buffer.
Solution:   Do not set 'bufhidden' to "hide".  Fix that a buffer where a
            terminal used to run is listed as "[Scratch]".
2017-08-29 22:44:59 +02:00
48340b62e8 patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Problem:    MS-Windows: Problem with $HOME when is was set internally.
Solution:   Only use the $HOME default internally. (Yasuhiro Matsumoto, closes
            #2013)
2017-08-29 22:08:53 +02:00
97f65fafdb patch 8.0.1011: terminal test fails with Athena and Motif
Problem:    Terminal test fails with Athena and Motif.
Solution:   Ignore the error for the input context. (Kazunobu Kuriyama)
2017-08-29 20:42:07 +02:00
17 changed files with 296 additions and 95 deletions

View File

@ -1902,6 +1902,26 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
always 95 or bigger). Pc is always zero.
{only when compiled with |+termresponse| feature}
*v:termblinkresp*
v:termblinkresp The escape sequence returned by the terminal for the |t_RC|
termcap entry. This is used to find out whether the terminal
cursor is blinking. This is used by |term_getcursor()|.
*v:termstyleresp*
v:termstyleresp The escape sequence returned by the terminal for the |t_RS|
termcap entry. This is used to find out what the shape of the
cursor is. This is used by |term_getcursor()|.
*v:termrgbresp*
v:termrgbresp The escape sequence returned by the terminal for the |t_RB|
termcap entry. This is used to find out what the terminal
background color is, see 'background'.
*v:termu7resp*
v:termu7resp The escape sequence returned by the terminal for the |t_u7|
termcap entry. This is used to find out what the terminal
does with ambiguous width characters, see 'ambiwidth'.
*v:testing* *testing-variable*
v:testing Must be set before using `test_garbagecollect_now()`.
Also, when set certain error messages won't be shown for 2

View File

@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 26
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -140,11 +140,17 @@ Syntax ~
When the buffer associated with the terminal is unloaded or wiped out the job
is killed, similar to calling `job_stop(job, "kill")`
By default the 'bufhidden' option of the buffer will be set to "hide".
So long as the job is running: If the window is closed the buffer becomes
hidden. The command will not be stopped. The `:buffer` command can be used
to turn the current window into a terminal window. If there are unsaved
changes this fails, use ! to force, as usual.
So long as the job is running the window behaves like it contains a modified
buffer. Trying to close the window with `CTRL-W :close` or `CTRL-W :hide`
fails, unless "!" is added, in which case the job is ended. The text in the
window is lost. The buffer still exists, but getting it in a window with
`:buffer` will show an
empty buffer.
You can use `CTRL-W :hide` to close the terminal window and make the buffer
hidden, the job keeps running. The `:buffer` command can be used to turn the
current window into a terminal window. If there are unsaved changes this
fails, use ! to force, as usual.
To have a background job run without a window, and open the window when it's
done, use options like this: >

View File

@ -2278,6 +2278,7 @@ test_arglist \
test_visual \
test_window_cmd \
test_window_id \
test_windows_home \
test_writefile \
test_alot_latin \
test_alot_utf8 \

View File

@ -5825,8 +5825,8 @@ buf_spname(buf_T *buf)
if (buf->b_term != NULL)
return term_get_status_text(buf->b_term);
#endif
if (buf->b_sfname != NULL)
return buf->b_sfname;
if (buf->b_fname != NULL)
return buf->b_fname;
return (char_u *)_("[Scratch]");
}

View File

@ -187,6 +187,10 @@ static struct vimvar
{VV_NAME("t_none", VAR_NUMBER), VV_RO},
{VV_NAME("t_job", VAR_NUMBER), VV_RO},
{VV_NAME("t_channel", VAR_NUMBER), VV_RO},
{VV_NAME("termrgbresp", VAR_STRING), VV_RO},
{VV_NAME("termu7resp", VAR_STRING), VV_RO},
{VV_NAME("termstyleresp", VAR_STRING), VV_RO},
{VV_NAME("termblinkresp", VAR_STRING), VV_RO},
};
/* shorthand */

View File

@ -1400,7 +1400,7 @@ static struct interval ambiguous[] =
* utf_char2cells() with different argument type for libvterm.
*/
int
utf_uint2cells(uint32_t c)
utf_uint2cells(UINT32_T c)
{
return utf_char2cells((int)c);
}
@ -2312,7 +2312,7 @@ utf_char2bytes(int c, char_u *buf)
* utf_iscomposing() with different argument type for libvterm.
*/
int
utf_iscomposing_uint(uint32_t c)
utf_iscomposing_uint(UINT32_T c)
{
return utf_iscomposing((int)c);
}

View File

@ -3750,10 +3750,33 @@ init_homedir(void)
var = mch_getenv((char_u *)"HOME");
#endif
if (var != NULL && *var == NUL) /* empty is same as not set */
var = NULL;
#ifdef WIN3264
/*
* Typically, $HOME is not defined on Windows, unless the user has
* specifically defined it for Vim's sake. However, on Windows NT
* platforms, $HOMEDRIVE and $HOMEPATH are automatically defined for
* each user. Try constructing $HOME from these.
*/
if (var == NULL || *var == NUL)
{
char_u *homedrive, *homepath;
homedrive = mch_getenv((char_u *)"HOMEDRIVE");
homepath = mch_getenv((char_u *)"HOMEPATH");
if (homepath == NULL || *homepath == NUL)
homepath = (char_u *)"\\";
if (homedrive != NULL
&& STRLEN(homedrive) + STRLEN(homepath) < MAXPATHL)
{
sprintf((char *)NameBuff, "%s%s", homedrive, homepath);
if (NameBuff[0] != NUL)
var = NameBuff;
}
}
if (var == NULL)
var = mch_getenv((char_u *)"USERPROFILE");
/*
* Weird but true: $HOME may contain an indirect reference to another
* variable, esp. "%USERPROFILE%". Happens when $USERPROFILE isn't set
@ -3774,40 +3797,14 @@ init_homedir(void)
{
vim_snprintf((char *)NameBuff, MAXPATHL, "%s%s", exp, p + 1);
var = NameBuff;
/* Also set $HOME, it's needed for _viminfo. */
vim_setenv((char_u *)"HOME", NameBuff);
}
}
}
/*
* Typically, $HOME is not defined on Windows, unless the user has
* specifically defined it for Vim's sake. However, on Windows NT
* platforms, $HOMEDRIVE and $HOMEPATH are automatically defined for
* each user. Try constructing $HOME from these.
*/
if (var == NULL)
{
char_u *homedrive, *homepath;
if (var != NULL && *var == NUL) /* empty is same as not set */
var = NULL;
homedrive = mch_getenv((char_u *)"HOMEDRIVE");
homepath = mch_getenv((char_u *)"HOMEPATH");
if (homepath == NULL || *homepath == NUL)
homepath = (char_u *)"\\";
if (homedrive != NULL
&& STRLEN(homedrive) + STRLEN(homepath) < MAXPATHL)
{
sprintf((char *)NameBuff, "%s%s", homedrive, homepath);
if (NameBuff[0] != NUL)
{
var = NameBuff;
/* Also set $HOME, it's needed for _viminfo. */
vim_setenv((char_u *)"HOME", NameBuff);
}
}
}
# if defined(FEAT_MBYTE)
# ifdef FEAT_MBYTE
if (enc_utf8 && var != NULL)
{
int len;
@ -3823,9 +3820,7 @@ init_homedir(void)
}
}
# endif
#endif
#if defined(MSWIN)
/*
* Default home dir is C:/
* Best assumption we can make in such a situation.
@ -3833,6 +3828,7 @@ init_homedir(void)
if (var == NULL)
var = (char_u *)"C:/";
#endif
if (var != NULL)
{
#ifdef UNIX
@ -4661,6 +4657,10 @@ home_replace(
homedir_env_orig = homedir_env = mch_getenv((char_u *)"SYS$LOGIN");
#else
homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
#endif
#ifdef WIN3264
if (homedir_env == NULL)
homedir_env_orig = homedir_env = mch_getenv((char_u *)"USERPROFILE");
#endif
/* Empty is the same as not set. */
if (homedir_env != NULL && *homedir_env == NUL)

View File

@ -607,11 +607,14 @@ check_cursor_col_win(win_T *win)
if (oldcoladd > win->w_cursor.col)
{
win->w_cursor.coladd = oldcoladd - win->w_cursor.col;
if (win->w_cursor.col < len && win->w_cursor.coladd > 0)
/* Make sure that coladd is not more than the char width.
* Not for the last character, coladd is then used when the cursor
* is actually after the last character. */
if (win->w_cursor.col + 1 < len && win->w_cursor.coladd > 0)
{
int cs, ce;
/* check that coladd is not more than the char width */
getvcol(win, &win->w_cursor, &cs, NULL, &ce);
if (win->w_cursor.coladd > ce - cs)
win->w_cursor.coladd = ce - cs;

View File

@ -10,7 +10,7 @@ int latin_char2len(int c);
int latin_char2bytes(int c, char_u *buf);
int latin_ptr2len(char_u *p);
int latin_ptr2len_len(char_u *p, int size);
int utf_uint2cells(uint32_t c);
int utf_uint2cells(UINT32_T c);
int utf_char2cells(int c);
int latin_ptr2cells(char_u *p);
int utf_ptr2cells(char_u *p);
@ -38,7 +38,7 @@ int utfc_ptr2len(char_u *p);
int utfc_ptr2len_len(char_u *p, int size);
int utf_char2len(int c);
int utf_char2bytes(int c, char_u *buf);
int utf_iscomposing_uint(uint32_t c);
int utf_iscomposing_uint(UINT32_T c);
int utf_iscomposing(int c);
int utf_printable(int c);
int utf_class(int c);

View File

@ -1369,9 +1369,7 @@ static int need_gather = FALSE; /* need to fill termleader[] */
static char_u termleader[256 + 1]; /* for check_termcode() */
#ifdef FEAT_TERMRESPONSE
static int check_for_codes = FALSE; /* check for key code response */
# ifdef MACOS
static int is_terminal_app = FALSE; /* recognized Terminal.app */
# endif
static int is_not_xterm = FALSE; /* recognized not-really-xterm */
#endif
static struct builtin_term *
@ -3506,13 +3504,10 @@ may_req_ambiguous_char_width(void)
/*
* Similar to requesting the version string: Request the terminal background
* color when it is the right moment.
* Also request the cursor shape, if possible.
*/
void
may_req_bg_color(void)
{
int did_one = FALSE;
if (can_get_termresponse() && starting == 0)
{
/* Only request background if t_RB is set and 'background' wasn't
@ -3524,20 +3519,7 @@ may_req_bg_color(void)
LOG_TR("Sending BG request");
out_str(T_RBG);
rbg_status = STATUS_SENT;
did_one = TRUE;
}
/* Only request cursor blinking mode if t_RC is set. */
if (rbm_status == STATUS_GET && *T_CRC != NUL)
{
LOG_TR("Sending BC request");
out_str(T_CRC);
rbm_status = STATUS_SENT;
did_one = TRUE;
}
if (did_one)
{
/* check for the characters now, otherwise they might be eaten by
* get_keystroke() */
out_flush();
@ -4505,6 +4487,9 @@ check_termcode(
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
slen = i + 1;
# ifdef FEAT_EVAL
set_vim_var_string(VV_TERMU7RESP, tp, slen);
# endif
}
else
#endif
@ -4530,6 +4515,8 @@ check_termcode(
if (tp[1 + (tp[0] != CSI)] == '>' && semicols == 2)
{
int need_flush = FALSE;
/* Only set 'ttymouse' automatically if it was not set
* by the user already. */
if (!option_was_set((char_u *)"ttym"))
@ -4566,35 +4553,53 @@ check_termcode(
may_adjust_color_count(256);
}
/* Detect terminals that set $TERM to something like
* "xterm-256colors" but are not fully xterm
* compatible. */
# ifdef MACOS
/* Mac Terminal.app sends 1;95;0 */
if (col == 95
&& STRNCMP(tp + extra - 2, "1;95;0c", 7) == 0)
{
/* Terminal.app sets $TERM to "xterm-256colors",
* but it's not fully xterm compatible. */
is_terminal_app = TRUE;
}
is_not_xterm = TRUE;
# endif
/* Gnome Terminal.app sends 1;4402;0, assuming any
* version number over 4000 is not an xterm. */
if (col >= 4000)
is_not_xterm = TRUE;
/* Only request the cursor style if t_SH and t_RS are
* set. Not for Terminal.app, it can't handle t_RS, it
* echoes the characters to the screen. */
if (rcs_status == STATUS_GET
# ifdef MACOS
&& !is_terminal_app
# endif
&& !is_not_xterm
&& *T_CSH != NUL
&& *T_CRS != NUL)
{
LOG_TR("Sending cursor style request");
out_str(T_CRS);
rcs_status = STATUS_SENT;
out_flush();
need_flush = TRUE;
}
/* Only request the cursor blink mode if t_RC set. Not
* for Gnome terminal, it can't handle t_RC, it
* echoes the characters to the screen. */
if (rbm_status == STATUS_GET
&& !is_not_xterm
&& *T_CRC != NUL)
{
LOG_TR("Sending cursor blink mode request");
out_str(T_CRC);
rbm_status = STATUS_SENT;
need_flush = TRUE;
}
if (need_flush)
out_flush();
}
slen = i + 1;
# ifdef FEAT_EVAL
set_vim_var_string(VV_TERMRESPONSE, tp, i + 1);
set_vim_var_string(VV_TERMRESPONSE, tp, slen);
# endif
# ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_TERMRESPONSE,
@ -4602,7 +4607,6 @@ check_termcode(
# endif
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
slen = i + 1;
}
/* Check blinking cursor from xterm:
@ -4626,6 +4630,9 @@ check_termcode(
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
slen = i + 1;
# ifdef FEAT_EVAL
set_vim_var_string(VV_TERMBLINKRESP, tp, slen);
# endif
}
/*
@ -4714,6 +4721,9 @@ check_termcode(
/* Sometimes the 0x07 is followed by 0x18, unclear
* when this happens. */
++slen;
# ifdef FEAT_EVAL
set_vim_var_string(VV_TERMRGBRESP, tp, slen);
# endif
break;
}
if (i == len)
@ -4788,6 +4798,9 @@ check_termcode(
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
slen = i + 1 + (tp[i] == ESC);
# ifdef FEAT_EVAL
set_vim_var_string(VV_TERMSTYLERESP, tp, slen);
# endif
}
}

View File

@ -44,10 +44,7 @@
* - add test for giving error for invalid 'termsize' value.
* - support minimal size when 'termsize' is "rows*cols".
* - support minimal size when 'termsize' is empty?
* - do not set bufhidden to "hide"? works like a buffer with changes.
* document that CTRL-W :hide can be used.
* - GUI: when using tabs, focus in terminal, click on tab does not work.
* - When $HOME was set by Vim (MS-Windows), do not pass it to the job.
* - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
* changes to "!shell".
* (justrajdeep, 2017 Aug 22)
@ -399,10 +396,6 @@ term_start(typval_T *argvar, jobopt_T *opt, int forceit)
* the job finished. */
curbuf->b_p_ma = FALSE;
/* Set 'bufhidden' to "hide": allow closing the window. */
set_string_option_direct((char_u *)"bufhidden", -1,
(char_u *)"hide", OPT_FREE|OPT_LOCAL, 0);
set_term_and_win_size(term);
setup_job_options(opt, term->tl_rows, term->tl_cols);
@ -1288,8 +1281,8 @@ term_paste_register(int prev_c UNUSED)
WCHAR *ret = NULL;
int length = 0;
MultiByteToWideChar_alloc(enc_codepage, 0, (char*)s, STRLEN(s),
&ret, &length);
MultiByteToWideChar_alloc(enc_codepage, 0, (char *)s,
(int)STRLEN(s), &ret, &length);
if (ret != NULL)
{
WideCharToMultiByte_alloc(CP_UTF8, 0,
@ -1299,7 +1292,7 @@ term_paste_register(int prev_c UNUSED)
}
#endif
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
s, STRLEN(s), NULL);
s, (int)STRLEN(s), NULL);
#ifdef WIN3264
if (tmp != s)
vim_free(s);
@ -1858,7 +1851,7 @@ handle_settermprop(
int length = 0;
MultiByteToWideChar_alloc(CP_UTF8, 0,
(char*)value->string, STRLEN(value->string),
(char*)value->string, (int)STRLEN(value->string),
&ret, &length);
if (ret != NULL)
{

View File

@ -205,7 +205,8 @@ NEW_TESTS = test_arabic.res \
test_writefile.res \
test_alot_latin.res \
test_alot_utf8.res \
test_alot.res
test_alot.res \
test_windows_home.res
# Explicit dependencies.

View File

@ -84,6 +84,7 @@ endfunc
func Test_terminal_hide_buffer()
let buf = Run_shell_in_terminal({})
setlocal bufhidden=hide
quit
for nr in range(1, winnr('$'))
call assert_notequal(winbufnr(nr), buf)
@ -356,13 +357,13 @@ func Test_finish_open_close()
call assert_equal(1, winnr('$'))
exe 'terminal ++open ' . cmd
close
close!
call WaitFor("winnr('$') == 2", waittime)
call assert_equal(2, winnr('$'))
bwipe
call term_start(cmd, {'term_finish': 'open'})
close
close!
call WaitFor("winnr('$') == 2", waittime)
call assert_equal(2, winnr('$'))
bwipe
@ -385,7 +386,7 @@ func Test_finish_open_close()
call assert_fails("call term_start(cmd, {'term_opencmd': 'split % and %d'})", 'E475:')
call term_start(cmd, {'term_finish': 'open', 'term_opencmd': '4split | buffer %d'})
close
close!
call WaitFor("winnr('$') == 2", waittime)
call assert_equal(2, winnr('$'))
call assert_equal(4, winheight(0))
@ -429,6 +430,10 @@ func Test_zz_terminal_in_gui()
if !CanRunGui()
return
endif
" Ignore the "failed to create input context" error.
call test_ignore_error('E285:')
gui -f
call assert_equal(1, winnr('$'))

View File

@ -1,7 +1,7 @@
" Tests for 'virtualedit'.
func Test_yank_move_change()
split
new
call setline(1, [
\ "func foo() error {",
\ "\tif n, err := bar();",
@ -29,3 +29,15 @@ func Test_yank_move_change()
set virtualedit=
set ts=8
endfunc
func Test_paste_end_of_line()
new
set virtualedit=all
call setline(1, ['456', '123'])
normal! gg0"ay$
exe "normal! 2G$lllA\<C-O>:normal! \"agP\r"
call assert_equal('123456', getline(2))
bwipe!
set virtualedit=
endfunc

View File

@ -0,0 +1,121 @@
" Test for $HOME on Windows.
if !has('win32')
finish
endif
let s:env = {}
func s:restore_env()
for i in keys(s:env)
exe 'let ' . i . '=s:env["' . i . '"]'
endfor
endfunc
func s:save_env(...)
for i in a:000
exe 'let s:env["' . i . '"]=' . i
endfor
endfunc
func s:unlet_env(...)
for i in a:000
exe 'let ' . i . '=""'
endfor
endfunc
func CheckHomeIsMissingFromSubprocessEnvironment()
silent! let out = system('set')
let env = filter(split(out, "\n"), 'v:val=~"^HOME="')
call assert_equal(0, len(env))
endfunc
func CheckHomeIsInSubprocessEnvironment(exp)
silent! let out = system('set')
let env = filter(split(out, "\n"), 'v:val=~"^HOME="')
let home = len(env) == 0 ? "" : substitute(env[0], '[^=]\+=', '', '')
call assert_equal(a:exp, home)
endfunc
func CheckHome(exp, ...)
call assert_equal(a:exp, $HOME)
call assert_equal(a:exp, expand('~', ':p'))
if !a:0
call CheckHomeIsMissingFromSubprocessEnvironment()
else
call CheckHomeIsInSubprocessEnvironment(a:1)
endif
endfunc
func Test_WindowsHome()
command! -nargs=* SaveEnv call <SID>save_env(<f-args>)
command! -nargs=* RestoreEnv call <SID>restore_env()
command! -nargs=* UnletEnv call <SID>unlet_env(<f-args>)
set noshellslash
let save_home = $HOME
SaveEnv $USERPROFILE $HOMEDRIVE $HOMEPATH
try
" Normal behavior: use $HOMEDRIVE and $HOMEPATH, ignore $USERPROFILE
let $USERPROFILE = 'unused'
let $HOMEDRIVE = 'C:'
let $HOMEPATH = '\foobar'
let $HOME = '' " Force recomputing "homedir"
call CheckHome('C:\foobar')
" Same, but with $HOMEPATH not set
UnletEnv $HOMEPATH
let $HOME = '' " Force recomputing "homedir"
call CheckHome('C:\')
" Use $USERPROFILE if $HOMEPATH and $HOMEDRIVE are empty
UnletEnv $HOMEDRIVE $HOMEPATH
let $USERPROFILE = 'C:\foo'
let $HOME = '' " Force recomputing "homedir"
call CheckHome('C:\foo')
" If $HOME is set the others don't matter
let $HOME = 'C:\bar'
let $USERPROFILE = 'unused'
let $HOMEDRIVE = 'unused'
let $HOMEPATH = 'unused'
call CheckHome('C:\bar', 'C:\bar')
" If $HOME contains %USERPROFILE% it is expanded
let $USERPROFILE = 'C:\foo'
let $HOME = '%USERPROFILE%\bar'
let $HOMEDRIVE = 'unused'
let $HOMEPATH = 'unused'
call CheckHome('C:\foo\bar', '%USERPROFILE%\bar')
" Invalid $HOME is kept
let $USERPROFILE = 'C:\foo'
let $HOME = '%USERPROFILE'
let $HOMEDRIVE = 'unused'
let $HOMEPATH = 'unused'
call CheckHome('%USERPROFILE', '%USERPROFILE')
" %USERPROFILE% not at start of $HOME is not expanded
let $USERPROFILE = 'unused'
let $HOME = 'C:\%USERPROFILE%'
let $HOMEDRIVE = 'unused'
let $HOMEPATH = 'unused'
call CheckHome('C:\%USERPROFILE%', 'C:\%USERPROFILE%')
if has('channel')
RestoreEnv
let $HOME = save_home
let env = ''
let job = job_start('cmd /c set', {'out_cb': {ch,x->[env,execute('let env=x')]}})
sleep 1
let env = filter(split(env, "\n"), 'v:val=="HOME"')
let home = len(env) == 0 ? "" : env[0]
call assert_equal('', home)
endif
finally
RestoreEnv
delcommand SaveEnv
delcommand RestoreEnv
delcommand UnletEnv
endtry
endfunc

View File

@ -769,6 +769,24 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1019,
/**/
1018,
/**/
1017,
/**/
1016,
/**/
1015,
/**/
1014,
/**/
1013,
/**/
1012,
/**/
1011,
/**/
1010,
/**/

View File

@ -2012,7 +2012,11 @@ typedef int sock_T;
#define VV_TYPE_NONE 78
#define VV_TYPE_JOB 79
#define VV_TYPE_CHANNEL 80
#define VV_LEN 81 /* number of v: vars */
#define VV_TERMRGBRESP 81
#define VV_TERMU7RESP 82
#define VV_TERMSTYLERESP 83
#define VV_TERMBLINKRESP 84
#define VV_LEN 85 /* number of v: vars */
/* used for v_number in VAR_SPECIAL */
#define VVAL_FALSE 0L