Shell interpolation does not work on Windows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
UltiSnips |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Shell interpolation does not work on Windows. Example
snippet dir "Insert contents of current directory"
`dir`
endsnippet
On expanding this, the output of the 'dir' command is not inserted. Interpolation for VimL and Python is working fine though.
The problem seems to be
File: plugin/
Line: 26
proc = subprocess.
In effect, this does not return anything (Note that the temporary file is correctly created and the interpolated code is written into it).
For this to work it is necessary to make the file executable. Line 23
has apparently no effect in Windows. Instead, the temporary file needs to be registered to an executable type by means of an appropriate extension. Changing line 19:
handle, path = tempfile.
by
handle, path = tempfile.
solves the problem in a cross-platform way, since the .bat extension has no relevance outside Windows.
Not sure if this is the most elegant/correct way.
Which version are you using? the current code already uses .bat for windows: https:/ /github. com/SirVer/ ultisnips/ blob/master/ plugin/ UltiSnips/ text_objects/ _shell_ code.py# L24