You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I opened this issue not for bug reporting, just post my success experience configing and using toggleterm.nvim on windows as I think this would be a great help if anyone who wants to setup an env like me.
@sslime336 thanks for posting this. There is actually a wiki which anyone should be able to edit on this repo so you can also add this there. Hopefully people also check this.
@OuyangIPC I'm not sure how toggle-term starts the terminal under the hood.
But the Windows default "/s /c" will be considered as directory "/s" and "/c" in GitBash, which is not what we want.
On the other hand, Setting shellcmdflag = -s will start GitBash in a non-interactive mode, and it works like a charm, haha.
@OuyangIPC I'm not sure how toggle-term starts the terminal under the hood. But the Windows default "/s /c" will be considered as directory "/s" and "/c" in GitBash, which is not what we want. On the other hand, Setting shellcmdflag = -s will start GitBash in a non-interactive mode, and it works like a charm, haha.
@eatPizza311 Thanks for you information, it's very helpful to me.
When I use shellcmdflag = -s, :!ls and friends does no longer work. When I use shellcmdflag = -c then toggleterm does no longer work. Did anyone encounter the same problem?
Activity
Zooce commentedon Jul 13, 2023
This was a lifesaver...thank you! Now I can actually use toggle term at work...
akinsho commentedon Jul 14, 2023
@sslime336 thanks for posting this. There is actually a wiki which anyone should be able to edit on this repo so you can also add this there. Hopefully people also check this.
sslime336 commentedon Jul 14, 2023
Sure, that would be more appropriate :-)
akinsho commentedon Jul 14, 2023
I'll close this out now but keep it pinned for other users
F2BEAR commentedon Jan 7, 2024
Hey, I tried the same using lazy.vim without success; do somebody know where should I place the vim.cmd conf?
xavierforge commentedon Jan 23, 2024
@F2BEAR
For lazy.vim you can set the following in your
init.luaor other place you like:Leeto1970 commentedon Jan 25, 2024
@eatPizza311 Hello, what's means "-s"? I look up ":help shellcmdflag", vim show default "-c", and "/s /c" in windows.
F2BEAR commentedon Jan 25, 2024
This is exactly what I needed, thanks!
xavierforge commentedon Jan 29, 2024
@OuyangIPC I'm not sure how toggle-term starts the terminal under the hood.
But the Windows default "/s /c" will be considered as directory "/s" and "/c" in GitBash, which is not what we want.
On the other hand, Setting
shellcmdflag = -swill start GitBash in a non-interactive mode, and it works like a charm, haha.Leeto1970 commentedon Feb 2, 2024
@eatPizza311 Thanks for you information, it's very helpful to me.
sewbacca commentedon Dec 30, 2024
When I use
shellcmdflag = -s,:!lsand friends does no longer work. When I useshellcmdflag = -cthen toggleterm does no longer work. Did anyone encounter the same problem?sewbacca commentedon Dec 30, 2024
Okay I found a workarround. It is ugly, but it works:
{ 'akinsho/toggleterm.nvim', version = "*", config = function () local toggleterm = require 'toggleterm' toggleterm.setup {} vim.keymap.set({ 'n', 't' }, "<C-\\>", function () vim.o.shellcmdflag = '-s' vim.cmd.ToggleTerm() vim.o.shellcmdflag = '-c' end) end }Leeto1970 commentedon Dec 31, 2024
This is what I used configure:
for toggleterm:
for neovim options: