Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load .bashrc when using wsl interoperability?

I've downloaded neovim 5.1 and made a symlink to it in .local/bin folder. After that I've added it to $PATH through .bashrc and aliased to vim:

alias vim="nvim"
export PATH=$HOME/.local/bin:$PATH

If I use vim command from inside the wsl I successfully launch neovim 5.1. However if I instead try to launch vim from powershell (wsl vim) .bashrc is ignored and vim 8.1 is launched instead. How can I make Powershell to use .bashrc in interoperability mode?

like image 939
hmukos Avatar asked May 03 '26 08:05

hmukos


1 Answers

wsl bash -ic vim
  • -i tells bash that the shell is interactive, which causes ~/.bashrc to be loaded.

  • -c cause the next argument to be executed as a command(s); it also causes the bash process to exit after command execution.

like image 155
mklement0 Avatar answered May 05 '26 07:05

mklement0



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!