LS job fails on windows vim if &shell is powershell
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- node.js, powershell, vim
- Domain
- operating-systems, tooling
Research direction
Start in autoload/copilot/client.vim, specifically copilot#client#New(), and inspect how the command is prepared when Vim runs on Windows with &shell set to PowerShell or pwsh. Reproduce the language-server launch in that environment and verify it also continues to work with the existing shell configuration; done means the server starts successfully without breaking other platforms.
Written by the indexing model from the issue text.
Description
The language server runs in node.js and is launched using:
> npx @github/copilot-language-server@^1.408.0 --stdio
the problem is that the plugin (see copilot.vim/autoload/copilot/client.vim function copilot#client#New())
uses:
job_start(['npx', '@github/copilot-language-server@^1.408.0', '--stdio'], ...)
which fails (is a win32 CreateProcess(...) issue) and should instead use:
job_start('npx "@github/copilot-language-server@^1.408.0" --stdio', ...)
The following patch works for me:
diff --git a/autoload/copilot/client.vim b/autoload/copilot/client.vim
index c3ec862..c052bc8 100644
--- a/autoload/copilot/client.vim
+++ b/autoload/copilot/client.vim
@@ -736,7 +736,7 @@ function! copilot#client#New() abort
let instance.workspaceFolders[folder.uri] = v:true
endfor
call copilot#logger#Debug('Spawning ' . join(command, ' '))
- let is_win_shell = has('win32') && &shellcmdflag !~# '^-'
+ let is_win_shell = has('win32') && ( &shell =~? 'powershell\|pwsh' || &shellcmdflag !~# '^-')
if is_win_shell && command[0] !~# '[\/]'
let exepath = exepath(command[0])
if exepath !~? '\.exe$\|^$'
- Dominant language
- Vim Script
- Stars
- 11.7k
- Forks
- 812
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/copilot.vim
-
Readme. Open
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
github/copilot.vim#302 ·
-
Micky Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
github/copilot.vim#301 ·
-
Difficulty 5/5 Over a week Newbie friendliness 5/100
github/copilot.vim#300 ·
-
Difficulty 5/5 Over a week Newbie friendliness 1/100
github/copilot.vim#299 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
github/copilot.vim#298 ·
All issues in github/copilot.vim
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
type:content-error
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stephrobert/blog-roadmap#15 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/windows-rs#4979 ·
-
0.kind: bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100