Skip to content

Commit e173fd0

Browse files
committed
patch 8.0.0747: :terminal without an argument doesn't work
Problem: :terminal without an argument doesn't work. Solution: Use the 'shell' option. (Yasuhiro Matsumoto, closes #1860)
1 parent 61a6605 commit e173fd0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/terminal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
* up.
3737
* - set buffer options to be scratch, hidden, nomodifiable, etc.
3838
* - set buffer name to command, add (1) to avoid duplicates.
39-
* - If [command] is not given the 'shell' option is used.
4039
* - Add a scrollback buffer (contains lines to scroll off the top).
4140
* Can use the buf_T lines, store attributes somewhere else?
4241
* - When the job ends:
@@ -163,6 +162,7 @@ ex_terminal(exarg_T *eap)
163162
exarg_T split_ea;
164163
win_T *old_curwin = curwin;
165164
term_T *term;
165+
char_u *cmd = eap->arg;
166166

167167
if (check_restricted() || check_secure())
168168
return;
@@ -195,8 +195,11 @@ ex_terminal(exarg_T *eap)
195195

196196
set_term_and_win_size(term);
197197

198+
if (cmd == NULL || *cmd == NUL)
199+
cmd = p_sh;
200+
198201
/* System dependent: setup the vterm and start the job in it. */
199-
if (term_and_job_init(term, term->tl_rows, term->tl_cols, eap->arg) == OK)
202+
if (term_and_job_init(term, term->tl_rows, term->tl_cols, cmd) == OK)
200203
{
201204
/* store the size we ended up with */
202205
vterm_get_size(term->tl_vterm, &term->tl_rows, &term->tl_cols);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
747,
772774
/**/
773775
746,
774776
/**/

0 commit comments

Comments
 (0)