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

Following HTML link is broken if shell is PowerShell #1343

Open
avysk opened this issue May 18, 2023 · 3 comments
Open

Following HTML link is broken if shell is PowerShell #1343

avysk opened this issue May 18, 2023 · 3 comments
Assignees
Labels
Windows Windows specific issues

Comments

@avysk
Copy link

avysk commented May 18, 2023

Plug 'vimwiki/vimwiki'
let g:vimwiki_list = [
      \ {'path': '~/OneDrive/vimwiki', 'list_margin': 2},
      \ {'path': '~/vimwiki', 'list_margin': 2} ]

let g:vimwiki_ext2syntax = {}
let g:vimwiki_folding = 'syntax'

autocmd FileType vimwiki setlocal tw=80
autocmd FileType vimwiki setlocal nowrap
autocmd FileType vimwiki setlocal foldmethod=syntax
autocmd FileType vimwiki setlocal foldlevel=2

Mediawiki. I am using Windows / PowerShell (core) and my shell is set to pwsh -nop -nol. Any attempt to open HTML link ends in E371: Command not found. In autoload/vimwiki/base.vim in win32_handler it tries to call start which does not exist (it is an alias normally). Replacing start with Start-Process in line 328 fixes the problem.

Version 2023.04.04.

@tinmarino
Copy link
Member

Hi @avysk,

Thank you for the report and the fix.
Could you please create a PR working on both PowerShell and Batch ?

@tinmarino tinmarino added the Windows Windows specific issues label Jun 22, 2023
@FocusedWolf
Copy link

I'm having an issue very similar with HTML links, E371: Command not found.

For me the problem is on line: 316

Changing: execute 'silent ! start "Title" /B ' . url
To: execute 'silent ! start ' . url
fixes it.

This might be a vim bug because the code looks correct.

I started gvim without any vimrc using: gvim -u NONE
and doing
:! start "Title" /B https://www.google.com
:! start "" /b https://www.google.com
:! start "" https://www.google.com
all give "E371: Command not found. shell returned -1"
:! start https://www.google.com
works.

Also no issue if i open cmd.exe and do [$ start "" /b https://www.google.com]. Weird.

@jfishe
Copy link

jfishe commented Mar 3, 2024

I'm having an issue very similar with HTML links, E371: Command not found.

For me the problem is on line: 316

Changing: execute 'silent ! start "Title" /B ' . url To: execute 'silent ! start ' . url fixes it.

The problem appears to be single quotes in the url string, which appear when shellslash is set.
Vim 9 or Windows 11 appears to have changed how !start works: It no longer accepts "Title"
and may issue E371: Command not found.

execute 'silent !start ' .. url works for cmd.exe.

execute 'silent ! start ' .. eval(url) works for pwsh.exe and pwoershell.exe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Windows specific issues
Projects
None yet
Development

No branches or pull requests

4 participants