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

Avoid git submodules in Windows hanging on "Hit any key to close this window..." #606

Closed
dezza opened this issue Mar 7, 2017 · 11 comments
Closed
Labels

Comments

@dezza
Copy link

dezza commented Mar 7, 2017

To make vim-plug completely unattended while installing plugins on Windows it should avoid the "Hit any key to close this window..." for repos with submodules by not using ! syntax which is used in the s:bang(cmd, ...) function used in s:update_finish()

Instead it could use the Python Command() class OR
silent ! but that is the unlikely solution - my guess is that there's a good reason it's not silent so you can verify it's not failing - so I guess the Python option is the best choice?

Please advice if this could be changed so we can avoid the cmd.exe window awaiting ENTER on each submodule.

I will submit a commit/pullrequest if you agree.

@junegunn
Copy link
Owner

junegunn commented Mar 8, 2017

Actually s:bang function implements a trick for skipping "ENTER key" prompt.

https://github.com/junegunn/vim-plug/blob/master/plug.vim#L791

Seems like it's not working on Windows, right? I'd like to see a pure Vim script solution to this rather than relying on python interface which is not guaranteed to be available.

@dezza
Copy link
Author

dezza commented Mar 8, 2017

Oh I see.

No on my official Windows Vim this still shows the prompt

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov  6 2016 17:20:44)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-69
Compiled by mool@tororo        

I will be willing to experiment with fixing this later and I agree I also do as much as possible in VimScript 👍

@nzbart
Copy link

nzbart commented Aug 20, 2017

@dezza did you make much progress on this? It would make unattended installations a lot smoother...

@dezza
Copy link
Author

dezza commented Aug 20, 2017

@nzbart I opted for another solution (https://github.com/airblade/voom)

I guess it's pretty easy once you find the offending line.

@nzbart
Copy link

nzbart commented Aug 21, 2017

@dezza thanks; something simple like voom sounds really good... unfortunately, it's not cross-platform, which I need it to be.

@dezza
Copy link
Author

dezza commented Aug 21, 2017

It is for me since I utilize WSL for Windows (shell) and mac already has shell.

@dezza dezza closed this as completed Aug 21, 2017
@dezza dezza reopened this Aug 21, 2017
@janlazo
Copy link
Contributor

janlazo commented Sep 1, 2017

Is this for GVim only?
No issues on terminal Vim.

@janlazo
Copy link
Contributor

janlazo commented Sep 1, 2017

@junegunn I can fix this but I need fzf#shellescape to replace s:shellesc for s:with_cd.

@junegunn
Copy link
Owner

junegunn commented Sep 1, 2017

@janlazo I believe we can safely replace the code of s:shellesc with that of fzf#shellescape.

@janlazo
Copy link
Contributor

janlazo commented Sep 1, 2017

I'm plan on using a batchfile for this but it will take awhile.
A short term fix to bypass the prompt is to prefix g:_plug_bang with silent

let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%')

@janlazo
Copy link
Contributor

janlazo commented Sep 11, 2017

If shellxquote is unset and fzf#shellescape is slightly modifed for escaping %, then we can run a :! command directly in Windows without tempname.
I'm experimenting with it for the accessing the help files for powershell in https://github.com/janlazo/dotvim8/blob/master/after/ftplugin/ps1.vim with the autoload functions in https://github.com/janlazo/dotvim8/blob/master/autoload/dotvim8.vim.
It's possible to use Vim 8 or Neovim's terminal to get around :! issues, especially in GVim, but I haven't started on Vim 8 terminal yet.

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

No branches or pull requests

4 participants