4646 * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
4747 * is disabled.
4848 * - cursor blinks in terminal on widows with a timer. (xtal8, #2142)
49+ * - When closing gvim with an active terminal buffer, the dialog suggests
50+ * saving the buffer. Should say something else. (Manas Thakur, #2215)
51+ * Also: #2223
4952 * - implement term_setsize()
53+ * - Termdebug does not work when Vim build with mzscheme. gdb hangs.
54+ * - Termdebug: issue #2154 might be avoided by adding -quiet to gdb?
55+ * patch by Christian, 2017 Oct 23.
5056 * - MS-Windows GUI: WinBar has tearoff item
5157 * - MS-Windows GUI: still need to type a key after shell exits? #1924
58+ * - What to store in a session file? Shell at the prompt would be OK to
59+ * restore, but others may not. Open the window and let the user start the
60+ * command?
5261 * - add test for giving error for invalid 'termsize' value.
5362 * - support minimal size when 'termsize' is "rows*cols".
5463 * - support minimal size when 'termsize' is empty?
@@ -3390,6 +3399,7 @@ term_and_job_init(
33903399{
33913400 WCHAR * cmd_wchar = NULL ;
33923401 WCHAR * cwd_wchar = NULL ;
3402+ WCHAR * env_wchar = NULL ;
33933403 channel_T * channel = NULL ;
33943404 job_T * job = NULL ;
33953405 DWORD error ;
@@ -3398,7 +3408,7 @@ term_and_job_init(
33983408 HANDLE child_thread_handle ;
33993409 void * winpty_err ;
34003410 void * spawn_config = NULL ;
3401- garray_T ga ;
3411+ garray_T ga_cmd , ga_env ;
34023412 char_u * cmd ;
34033413
34043414 if (dyn_winpty_init (TRUE) == FAIL )
@@ -3408,17 +3418,23 @@ term_and_job_init(
34083418 cmd = argvar -> vval .v_string ;
34093419 else
34103420 {
3411- ga_init2 (& ga , (int )sizeof (char * ), 20 );
3412- if (win32_build_cmd (argvar -> vval .v_list , & ga ) == FAIL )
3421+ ga_init2 (& ga_cmd , (int )sizeof (char * ), 20 );
3422+ if (win32_build_cmd (argvar -> vval .v_list , & ga_cmd ) == FAIL )
34133423 goto failed ;
3414- cmd = ga .ga_data ;
3424+ cmd = ga_cmd .ga_data ;
34153425 }
34163426
34173427 cmd_wchar = enc_to_utf16 (cmd , NULL );
34183428 if (cmd_wchar == NULL )
34193429 return FAIL ;
34203430 if (opt -> jo_cwd != NULL )
34213431 cwd_wchar = enc_to_utf16 (opt -> jo_cwd , NULL );
3432+ if (opt -> jo_env != NULL )
3433+ {
3434+ ga_init2 (& ga_env , (int )sizeof (char * ), 20 );
3435+ win32_build_env (opt -> jo_env , & ga_env );
3436+ env_wchar = ga_env .ga_data ;
3437+ }
34223438
34233439 job = job_alloc ();
34243440 if (job == NULL )
@@ -3446,7 +3462,7 @@ term_and_job_init(
34463462 NULL ,
34473463 cmd_wchar ,
34483464 cwd_wchar ,
3449- NULL ,
3465+ env_wchar ,
34503466 & winpty_err );
34513467 if (spawn_config == NULL )
34523468 goto failed ;
@@ -3519,7 +3535,9 @@ term_and_job_init(
35193535
35203536failed :
35213537 if (argvar -> v_type == VAR_LIST )
3522- vim_free (ga .ga_data );
3538+ vim_free (ga_cmd .ga_data );
3539+ if (opt -> jo_env != NULL )
3540+ vim_free (ga_env .ga_data );
35233541 vim_free (cmd_wchar );
35243542 vim_free (cwd_wchar );
35253543 if (spawn_config != NULL )
0 commit comments