import { op } from "https://deno.land/x/ddc_vim@v4.3.0/deps.ts";
const { shell } = op;
Name of the shell to use for ! and :! commands. When changing the
value also check these options: 'shelltype', 'shellpipe', 'shellslash'
'shellredir', 'shellquote', 'shellxquote' and 'shellcmdflag'.
It is allowed to give an argument to the command, e.g. "csh -f".
See option-backslash
about including spaces and backslashes.
Environment variables are expanded :set_env
.
In restricted-mode
shell commands will not be possible. This mode
is used if the value of $SHELL ends in "false" or "nologin".
If the name of the shell contains a space, you need to enclose it in quotes and escape the space. Example with quotes:
:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
Note the backslash before each quote (to avoid starting a comment) and each space (to avoid ending the option value). Also note that the "-f" is not inside the quotes, because it is not part of the command name. Vim automagically recognizes the backslashes that are path separators. Example with escaped space (Vim will do this when initializing the option from $SHELL):
:set shell=/bin/with\\\ space/sh
The resulting value of 'shell' is "/bin/with\ space/sh", two
backslashes are consumed by :set
.
Under MS-Windows, when the executable ends in ".com" it must be included. Thus setting the shell to "command.com" or "4dos.com" works, but "command" and "4dos" do not work for all commands (e.g., filtering). For unknown reasons, when using "4dos.com" the current directory is changed to "C:". To avoid this set 'shell' like this:
:set shell=command.com\ /c\ 4dos
This option cannot be set from a modeline
or in the sandbox
, for
security reasons.
(default $SHELL or "sh", Win32: "cmd.exe")