comparison src/terminal.c @ 11794:2e7e77e28063 v8.0.0779

patch 8.0.0779: :term without an argument uses empty buffer name commit https://github.com/vim/vim/commit/293424c199615b774365db9b412209b102cdfe20 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 26 23:11:01 2017 +0200 patch 8.0.0779: :term without an argument uses empty buffer name Problem: :term without an argument uses empty buffer name but runs the snell. Solution: Change the command to the shell earlier.
author Christian Brabandt <cb@256bit.org>
date Wed, 26 Jul 2017 23:15:04 +0200
parents 4bc1f94afc34
children 4d545cd33f0a
comparison
equal deleted inserted replaced
11793:393a5d6b794a 11794:2e7e77e28063
197 197
198 /* Link the new terminal in the list of active terminals. */ 198 /* Link the new terminal in the list of active terminals. */
199 term->tl_next = first_term; 199 term->tl_next = first_term;
200 first_term = term; 200 first_term = term;
201 201
202 if (cmd == NULL || *cmd == NUL)
203 cmd = p_sh;
204
202 if (buflist_findname(cmd) == NULL) 205 if (buflist_findname(cmd) == NULL)
203 curbuf->b_ffname = vim_strsave(cmd); 206 curbuf->b_ffname = vim_strsave(cmd);
204 else 207 else
205 { 208 {
206 int i; 209 int i;
224 curbuf->b_p_ma = FALSE; 227 curbuf->b_p_ma = FALSE;
225 set_string_option_direct((char_u *)"buftype", -1, 228 set_string_option_direct((char_u *)"buftype", -1,
226 (char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0); 229 (char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0);
227 230
228 set_term_and_win_size(term); 231 set_term_and_win_size(term);
229
230 if (cmd == NULL || *cmd == NUL)
231 cmd = p_sh;
232 232
233 /* System dependent: setup the vterm and start the job in it. */ 233 /* System dependent: setup the vterm and start the job in it. */
234 if (term_and_job_init(term, term->tl_rows, term->tl_cols, cmd) == OK) 234 if (term_and_job_init(term, term->tl_rows, term->tl_cols, cmd) == OK)
235 { 235 {
236 /* store the size we ended up with */ 236 /* store the size we ended up with */