akinsho / akinsho/toggleterm.nvim

Is it possible to include double quotes in the `cmd` argument?

Open
#508 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
Lua
Stars
5.6k
Forks
206
PR merge metrics
No merged PRs in 30d

Description

I run Windows, and due to organizational constraints I'm forced to have spaces in my directories. I frequently want to execute the open Python file with `TermExec cmd="python %"`. As you can imagine, this causes issues if `%` expands to a path with a space, as you get e.g.:
> python C:/this/is the/file/path.py
Can't open file 'C:/this/is': no such file or directory.

I've tried every which way to escape quotes, mixing single and double quotes, escaping spaces with backslashes/backticks, etc., but I'm getting nowhere. Using the `dir` argument to `TermExec` works if the terminal is not open yet, but it will not change the working directory if there's an open terminal already.

Thoughts?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.