aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/ex_terminal_spec.lua
diff options
context:
space:
mode:
authorJack Bracewell <jack.bracewell@unboxedconsulting.com>2016-03-29 13:47:30 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-03-17 17:47:33 +0100
commit2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec (patch)
treeb0d34745e7573d285340fdf147d9afcf098fb096 /test/functional/terminal/ex_terminal_spec.lua
parent0c1f7831649e92b6904ca580ee90acd6ba89d1a8 (diff)
downloadrneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.tar.gz
rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.tar.bz2
rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.zip
terminal: Support extra arguments in 'shell'. #4504
Tokenize p_sh if used as default in ex_terminal(). Previously p_sh was used as the first arg in a list when calling termopen(), this would try to call an untokenized version of shell, meaning if you had an argument in 'shell': set shell=/bin/bash\ --login the command would fail. Helped-by: oni-link <knil.ino@gmail.com> Closes #3999
Diffstat (limited to 'test/functional/terminal/ex_terminal_spec.lua')
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 7a9d2a9b36..9bb683f25f 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -79,6 +79,30 @@ describe(':terminal (with fake shell)', function()
]])
end)
+ it("with no argument, and 'shell' is set to empty string", function()
+ nvim('set_option', 'shell', '')
+ terminal_with_fake_shell()
+ wait()
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ E91: 'shell' option is empty |
+ ]])
+ end)
+
+ it("with no argument, but 'shell' has arguments, acts like termopen()", function()
+ nvim('set_option', 'shell', nvim_dir..'/shell-test -t jeff')
+ terminal_with_fake_shell()
+ wait()
+ screen:expect([[
+ jeff $ |
+ [Process exited 0] |
+ |
+ -- TERMINAL -- |
+ ]])
+ end)
+
it('executes a given command through the shell', function()
terminal_with_fake_shell('echo hi')
wait()
@@ -90,6 +114,18 @@ describe(':terminal (with fake shell)', function()
]])
end)
+ it("executes a given command through the shell, when 'shell' has arguments", function()
+ nvim('set_option', 'shell', nvim_dir..'/shell-test -t jeff')
+ terminal_with_fake_shell('echo hi')
+ wait()
+ screen:expect([[
+ jeff $ echo hi |
+ |
+ [Process exited 0] |
+ -- TERMINAL -- |
+ ]])
+ end)
+
it('allows quotes and slashes', function()
terminal_with_fake_shell([[echo 'hello' \ "world"]])
wait()