Skip to content

Commit

Permalink
Merge 73286a8 into 8d1ccb6
Browse files Browse the repository at this point in the history
  • Loading branch information
nelstrom committed Aug 21, 2017
2 parents 8d1ccb6 + 73286a8 commit 87a7bf4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
1 change: 0 additions & 1 deletion runtime/doc/various.txt
Expand Up @@ -212,7 +212,6 @@ g8 Print the hex values of the bytes used in the
Equivalent to: >
:enew
:call termopen('{cmd}')
:startinsert
<
See |termopen()|.

Expand Down
4 changes: 2 additions & 2 deletions src/nvim/ex_docmd.c
Expand Up @@ -9835,7 +9835,7 @@ static void ex_terminal(exarg_T *eap)
if (*eap->arg != NUL) { // Run {cmd} in 'shell'.
char *name = (char *)vim_strsave_escaped(eap->arg, (char_u *)"\"\\");
snprintf(ex_cmd, sizeof(ex_cmd),
":enew%s | call termopen(\"%s\") | startinsert",
":enew%s | call termopen(\"%s\")",
eap->forceit ? "!" : "", name);
xfree(name);
} else { // No {cmd}: run the job with tokenized 'shell'.
Expand All @@ -9857,7 +9857,7 @@ static void ex_terminal(exarg_T *eap)
shell_free_argv(argv);

snprintf(ex_cmd, sizeof(ex_cmd),
":enew%s | call termopen([%s]) | startinsert",
":enew%s | call termopen([%s])",
eap->forceit ? "!" : "", shell_argv + 1);
}

Expand Down
4 changes: 2 additions & 2 deletions test/functional/core/job_spec.lua
Expand Up @@ -677,12 +677,12 @@ describe("pty process teardown", function()

-- Exiting should terminate all descendants (PTY, its children, ...).
screen:expect([[
|
^ |
[Process exited 0] |
|
|
|
-- TERMINAL -- |
|
]])
end)
end)
28 changes: 14 additions & 14 deletions test/functional/terminal/ex_terminal_spec.lua
Expand Up @@ -72,10 +72,10 @@ describe(':terminal (with fake shell)', function()
terminal_with_fake_shell()
wait()
screen:expect([[
ready $ |
^ready $ |
[Process exited 0] |
|
-- TERMINAL -- |
:terminal |
]])
end)

Expand All @@ -96,21 +96,21 @@ describe(':terminal (with fake shell)', function()
terminal_with_fake_shell()
wait()
screen:expect([[
jeff $ |
^jeff $ |
[Process exited 0] |
|
-- TERMINAL -- |
:terminal |
]])
end)

it('executes a given command through the shell', function()
terminal_with_fake_shell('echo hi')
wait()
screen:expect([[
ready $ echo hi |
^ready $ echo hi |
|
[Process exited 0] |
-- TERMINAL -- |
:terminal echo hi |
]])
end)

Expand All @@ -119,21 +119,21 @@ describe(':terminal (with fake shell)', function()
terminal_with_fake_shell('echo hi')
wait()
screen:expect([[
jeff $ echo hi |
^jeff $ echo hi |
|
[Process exited 0] |
-- TERMINAL -- |
:terminal echo hi |
]])
end)

it('allows quotes and slashes', function()
terminal_with_fake_shell([[echo 'hello' \ "world"]])
wait()
screen:expect([[
ready $ echo 'hello' \ "world" |
^ready $ echo 'hello' \ "world" |
|
[Process exited 0] |
-- TERMINAL -- |
:terminal echo 'hello' \ "world" |
]])
end)

Expand Down Expand Up @@ -166,10 +166,10 @@ describe(':terminal (with fake shell)', function()
terminal_with_fake_shell()
wait()
screen:expect([[
ready $ |
^ready $ |
[Process exited 0] |
|
-- TERMINAL -- |
:terminal |
]])
eq('term://', string.match(eval('bufname("%")'), "^term://"))
helpers.feed([[<C-\><C-N>]])
Expand All @@ -184,10 +184,10 @@ describe(':terminal (with fake shell)', function()
it('works with gf', function()
terminal_with_fake_shell([[echo "scripts/shadacat.py"]])
screen:expect([[
ready $ echo "scripts/shadacat.py" |
^ready $ echo "scripts/shadacat.py" |
|
[Process exited 0] |
-- TERMINAL -- |
:terminal echo "scripts/shadacat.py" |
]])
helpers.feed([[<C-\><C-N>]])
eq('term://', string.match(eval('bufname("%")'), "^term://"))
Expand Down
8 changes: 4 additions & 4 deletions test/functional/terminal/tui_spec.lua
Expand Up @@ -287,8 +287,8 @@ describe('tui focus event handling', function()
feed_data(':terminal\n')
feed_data('\027[I')
screen:expect([[
ready $ |
[Process exited 0]{1: } |
{1:r}eady $ |
[Process exited 0] |
|
|
|
Expand All @@ -297,8 +297,8 @@ describe('tui focus event handling', function()
]])
feed_data('\027[O')
screen:expect([[
ready $ |
[Process exited 0]{1: } |
{1:r}eady $ |
[Process exited 0] |
|
|
|
Expand Down

0 comments on commit 87a7bf4

Please sign in to comment.