Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some CoC extension features doesn't work when there's a space in the home directory on Windows #4964

Open
nelsyeung opened this issue Mar 29, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@nelsyeung
Copy link

Result from CocInfo

versions

vim version: VIM - Vi IMproved 9.1 9010000
node version: v18.20.0
coc.nvim version: 0.0.82-9190bfef 2024-03-26 09:16:19 +0800
coc.nvim directory: C:\Users\Nelson Yeung.vim\plugged\coc.nvim
term: undefined
platform: win32

Log of coc.nvim

2024-03-29T11:53:39.631 WARN (pid:17352) [workspace] - workspace.createStatusBarItem is deprecated, please use window.createStatusBarItem instead. 
    at Object.<anonymous> (C:\Users\Nelson Yeung\AppData\Local\coc\extensions\node_modules\coc-powershell\out\client\extension.js:175:51)
    at Generator.next (<anonymous>)
2024-03-29T11:53:39.632 WARN (pid:17352) [workspace] - workspace.createOutputChannel is deprecated, please use window.createOutputChannel instead. 
    at new PowerShellProcess (C:\Users\Nelson Yeung\AppData\Local\coc\extensions\node_modules\coc-powershell\out\client\process.js:30:37)
    at C:\Users\Nelson Yeung\AppData\Local\coc\extensions\node_modules\coc-powershell\out\client\extension.js:65:20
2024-03-29T11:53:39.633 WARN (pid:17352) [workspace] - workspace.createTerminal is deprecated, please use window.createTerminal instead. 
    at PowerShellProcess.<anonymous> (C:\Users\Nelson Yeung\AppData\Local\coc\extensions\node_modules\coc-powershell\out\client\process.js:65:59)
    at Generator.next (<anonymous>)
2024-03-29T11:53:39.636 INFO (pid:17352) [plugin] - coc.nvim initialized with node: v18.20.0 after 382
2024-03-29T11:53:39.645 INFO (pid:17352) [attach] - receive notification: highlight []
2024-03-29T11:53:44.574 ERROR (pid:17352) [timing] - activate coc-powershell timeout after 5000ms
2024-03-29T11:55:06.417 INFO (pid:17352) [attach] - receive notification: showInfo []

Describe the bug

I'm getting this error when using coc-powershell:

C:\Users\Nelson : The term 'C:\Users\Nelson' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at line:1 char:1
+ C:\Users\Nelson Yeung\ AppData\Local\coc\extensions\node_modules\coc-p ...

As can be seen, the path is incomplete, my full home directory path is C:\Users\Nelson Yeung. Hence, the term: undefined in CocInfo.

I'm logging this issue here because I believe it's a wider problem as some other CoC extensions like coc-flutter and coc-prettier don't work too. Although, admittedly, I don't know whether it's related to this problem.

Reproduce the bug

  • Create file mini.vim with:

    set nocompatible
    set runtimepath^=~\vimfiles\plugged\coc.nvim
    filetype plugin indent on
    syntax on
    set hidden
    let g:coc_global_extensions = ['coc-powershell']
  • Start (neo)vim with command: vim -u mini.vim a.ps1

  • Add these, it seems to help to delay the error message:

    Set-PSReadLineOption -Colors @{
        Default = "Yellow"
        Number  = "Yellow"
        Parameter = "Yellow"
    }
    Set-Alias -Name g -Value git

Screenshots (optional)

Screenshot 2024-03-29 120654

@fannheyward fannheyward added the help wanted Extra attention is needed label Apr 2, 2024
@fannheyward
Copy link
Member

I don't have an environment to debug on Windows in order to get the full home directory. Any help would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants