I tried the WSL and it isn't quite seamless enough for me. I ran in to problems when editing in VSCode and having watchers on my files (ng serve
, dotnet watch run
, etc.). In addition, I kept running in to problems that only manifest themselves when running in WSL. For example, this issue with doing production builds and the terser plugin has made many a developer rage-quit on using WSL. Just figuring out that it was an issue with the WSL took a lot of time.
That terser plugin issue was never resolved and I ended up having to keep a git bash window open in addition to my WSL console window so I could do production builds. To make matters worse, my npm packages were platform-dependent so I couldn't use the same project folder. So, my procedure was: commit whatever changes to test branch, push to repo, git pull
on my "windows" project folder, and do a production build there. It wasn't untenable but it was far from ideal.
- Install git with git bash.
- Install msys2. Follow instructions on that page and be sure to close window when it tells you to and reopen to complete setup.
- In a msys2 window, use Pacman to install tmux (
pacman -S tmux
). - Copy
tmux
andmsys-event
binaries from msys2 bin folder (probablyC:\msys64\usr\bin
) to git bash bin folder (probablyC:\Program Files\Git\usr\bin
). - Restart your git bash and try
tmux
command.
If everything went according to plan, you should see tmux running in your git bash:
If you run npm
commands, you get no progress spinner or colors. The solution is to use winpty (which is installed as part of the git bash
shell as it uses msys
). Here's an example of an npm install
with and without winpty:
To always use winpty, edit your bashrc (vim ~/.bashrc
) and add the following alias:
alias npm="winpty npm.cmd"
Hi, I used this method and it seems like TMUX now works on Gitbash (MINGW64). However, I'm trying to get a Neovim setup working to run Neovim with TMUX terminal (and later Quarto to do Python and R analyses). When I try to open a file with nvim, it opens, but it doesn't react to keystrokes. It looks like it's just terminal output with the Neovim window and the words "Press ENTER or type command to continue." The terminal becomes non-reactive at this point.
I found this thread:
msys2/MSYS2-packages#3150
I don't know if that transfers to gitbash?
Additional clue: I have conda running in gitbash and when running TMUX it opens with the error:
"Did not find path entry /c/Users/USER/anaconda3/bin"
yet conda seems to work fine at first glance.
Has anyone successfully run Neovim from TMUX in GitBash on windows, or has any suggestions on what to do?
EDIT. Running nvim after adding the first half of the .tmux.conf file commented by EricYoung37 worked!
Unable to solve the conda error for now, but conda seems to work from TMUX. If somebody has any good ideas, I'd appreciate it.
I can't seem to find the file that adds /c/Users/USER/anaconda3/bin to PATH. There just is no such folder (checked: .bashrc .bash_profile .tmux.conf environmental variables from windows, redone conda init bash)
EDIT 2. The conda error was fixed by adding the following line to .tmux.conf (command "python" ran different python from TMUX)
and the next paragraph to .bashrc after conda initialize
(from https://stackoverflow.com/questions/57660263/tmux-recognised-conda-env-but-still-use-the-default-python)
It's a little slow on the initialization, but it works