Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ require("toggleterm").setup{
close_on_exit = true, -- close the terminal window when the process exits
-- Change the default shell. Can be a string or a function returning a string
shell = vim.o.shell,
quote_command = false, -- put quotes arround the command sent to the terminal, required for Windows using git bash
auto_scroll = true, -- automatically scroll to the bottom on terminal output
-- This field is only relevant if direction is set to 'float'
float_opts = {
Expand Down
1 change: 1 addition & 0 deletions doc/toggleterm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ what options are available. It is not written to be used as is.
close_on_exit = true, -- close the terminal window when the process exits
-- Change the default shell. Can be a string or a function returning a string
shell = vim.o.shell,
quote_command = false -- put quotes around the command being sent to the terminal. Required for Windows using git bash
auto_scroll = true, -- automatically scroll to the bottom on terminal output
-- This field is only relevant if direction is set to 'float'
float_opts = {
Expand Down
1 change: 1 addition & 0 deletions lua/toggleterm/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ local config = {
direction = "horizontal",
shading_factor = constants.shading_amount,
shell = vim.o.shell,
quote_command = false,
autochdir = false,
auto_scroll = true,
winbar = {
Expand Down
3 changes: 3 additions & 0 deletions lua/toggleterm/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,16 @@ function Terminal:__spawn()
if type(cmd) == "function" then cmd = cmd() end
local command_sep = get_command_sep()
local comment_sep = get_comment_sep()
local quote = config.get("quote_command") and "\"" or ""
cmd = table.concat({
quote,
cmd,
command_sep,
comment_sep,
constants.FILETYPE,
comment_sep,
self.id,
quote,
})
local dir = _get_dir(self.dir)
self.job_id = fn.termopen(cmd, {
Expand Down