Wednesday, February 2, 2022

Re: Use wsl's bash as shell on Windows 10

2022-02-01 22:44 GMT+03:00, Justus Kidding <ichbinterra@gmail.com>:
> Hi!
>
> I am trying to set up bash as my default shell for vim. However I am not
> able to get it to work. This is the current setup which allows for commands
>
> without arguments to be executed:
> if has('win32')
> set shell=bash
> set shellpipe=|
> set shellredir=>
> set shellcmdflag=-c
> endif
> For example, !ls executes as expected and prints the content of the current
>
> directory. However if I wanted to do !ls ~ the following error appears:
> :!ls ~
> /bin/bash: ls ~: command not found
> Shell exited 127
>
> What would be the correct way to setup bash.exe as the shell?
>
> Thanks!
> Terra
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_use+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/12e463b4-dd4a-4a2d-abb5-97fbd30e6cacn%40googlegroups.com.
>

Hello,

Quoting my own config verbatim:

if has('win32')
set shell=bash shellcmdflag=-c shellredir=>%s\ 2>&1 shellslash noshelltemp
let &shellxescape = ''
let &shellxquote = has('nvim') ? '' : '"'
let $CYGWIN = 'noglob'
let $MSYS = 'noglob'
endif

Of course, you don't need has('nvim'), $CYGWIN or $MSYS if you have
neither of these.

Also, I'm not sure which one shall be correct for WSL and/or specific
Vim patch: shelltemp or noshelltemp? You may want to try both.

Regards,
Matvey

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAFsTB%2BKkwM6J_Hmq4%2BWPyeZug%3DZY3eDO68mRGaRhcWRdv0rb8A%40mail.gmail.com.

No comments: