* in tl_scrollback are no longer used.
*
* TODO:
- * - check for memory leaks
* - patch to use GUI or cterm colors for vterm. Yasuhiro, #2067
+ * - when Normal background is not white or black, going to Terminal-Normal
+ * mode does not clear correctly. Use the terminal background color to erase
+ * the background.
+ * - patch to add tmap, jakalope (Jacob Askeland) #2073
* - Redirecting output does not work on MS-Windows.
* - implement term_setsize()
* - add test for giving error for invalid 'termsize' value.
jobopt_T *opt)
{
WCHAR *cmd_wchar = NULL;
+ WCHAR *cwd_wchar = NULL;
channel_T *channel = NULL;
job_T *job = NULL;
DWORD error;
cmd_wchar = enc_to_utf16(cmd, NULL);
if (cmd_wchar == NULL)
return FAIL;
+ if (opt->jo_cwd != NULL)
+ cwd_wchar = enc_to_utf16(opt->jo_cwd, NULL);
job = job_alloc();
if (job == NULL)
WINPTY_SPAWN_FLAG_EXIT_AFTER_SHUTDOWN,
NULL,
cmd_wchar,
- NULL,
+ cwd_wchar,
NULL,
&winpty_err);
if (spawn_config == NULL)
winpty_spawn_config_free(spawn_config);
vim_free(cmd_wchar);
+ vim_free(cwd_wchar);
create_vterm(term, term->tl_rows, term->tl_cols);
failed:
if (argvar->v_type == VAR_LIST)
vim_free(ga.ga_data);
- if (cmd_wchar != NULL)
- vim_free(cmd_wchar);
+ vim_free(cmd_wchar);
+ vim_free(cwd_wchar);
if (spawn_config != NULL)
winpty_spawn_config_free(spawn_config);
if (channel != NULL)
endfunc
func Test_terminal_cwd()
- if !has('unix')
+ if !executable('pwd')
return
endif
call mkdir('Xdir')
let buf = term_start('pwd', {'cwd': 'Xdir'})
- sleep 100m
- call term_wait(buf)
- call assert_equal(getcwd() . '/Xdir', getline(1))
+ call WaitFor('"Xdir" == fnamemodify(getline(1), ":t")')
+ call assert_equal('Xdir', fnamemodify(getline(1), ":t"))
exe buf . 'bwipe'
call delete('Xdir', 'rf')
call term_wait(buf)
call WaitFor('len(readfile("Xfile")) > 0')
call assert_match('123', readfile('Xfile')[0])
+ let g:job = term_getjob(buf)
+ call WaitFor('job_status(g:job) == "dead"')
call delete('Xfile')
bwipe
endif