Wednesday, February 2, 2022

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


Thanks! That worked perfectly! How were you able to figure it out, as in, what was your thought process when writing your config? Asking so I can maybe help myself in the future :)
matthew...@gmail.com schrieb am Mittwoch, 2. Februar 2022 um 12:21:32 UTC+1:
2022-02-01 22:44 GMT+03:00, Justus Kidding <ichbi...@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+u...@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/b11896fa-de89-464e-8fbe-e20d69d838d8n%40googlegroups.com.

No comments: