|
1 | | -# wsl_proxy: A way to use your WSL Linux binaries as Windows programs |
| 1 | +# wsl_proxy: Use your WSL binaries as Windows programs |
2 | 2 |
|
3 | | -Have you ever made an `ls.bat`? Or maybe even something that looked a little like this? |
| 3 | +Have you ever written `ls.bat`? Maybe something that looks similar to this? |
4 | 4 |
|
5 | 5 | ```batch |
6 | 6 | @echo off |
7 | 7 | bash -c 'git %*' |
8 | 8 | ``` |
9 | 9 |
|
10 | | -Thankfully, these batch files work pretty nicely if you don't want to install two versions of every tool you have; one for Linux, and one for Windows. But unfortunately, you can't set `.bat` files as the default program you open certain files with, and you can't readily use a lot of these with IDEs since they often simply don't accept `.bat` files in place of, for example, `git.exe`. |
| 10 | +Thankfully, these batch files work pretty nicely if you don't want to install two versions of every tool you have; one for Linux, and one for Windows. But unfortunately, you can't set `.bat` files as the default program to open files with, and you can't readily use a lot of these with IDEs since they often simply don't accept `.bat` files. You might also encounter path translation issues between systems. |
11 | 11 |
|
12 | 12 | Enter wsl_proxy! |
13 | 13 |
|
14 | | -[](https://asciinema.org/a/KMItxCIV03k7uXEyMRy6qjD6P) |
| 14 | + |
15 | 15 |
|
16 | 16 | If you rename it to `git.exe`, it will be WSL git. If you name it `emacs.exe`, it's gonna be WSL Emacs! You can put these in your path, give them to IDEs to use, and even assign your favorite Linux text editors as your default editor program, in Windows! |
17 | 17 |
|
18 | 18 | There is the added bonus that you don't need to configure multiple versions of things twice either! So if you have, for example, a fancy SSH configuration, not only can you still `ssh hostBehindProxyJumps` with your configs and your keys, your `git.exe` will also use them! |
19 | 19 |
|
20 | | -If you give wsl_proxy Windows paths, it will even translate them with `wslpath`, so you can run things like `git -C E:\SomePath\ log` and you'll get the result you probably intended. (IE: It Actually Working) |
| 20 | +If you give wsl_proxy Windows paths, it will even translate them with `wslpath`, so you can run things like `git -C E:\SomePath\ log` and have it just work as expected. |
21 | 21 |
|
22 | | -If you are space conscious of the binary size, but want a mirror of everything you have in Windows, you can even just hardlink everything you like in several WSL folders. (Yes, WSL hadlinking works on NTFS) |
23 | | - |
24 | | -```bash |
25 | | -for bin in ls emacs vim nano git ssh; do |
26 | | - ln wsl_proxy.exe $bin.exe |
27 | | -done |
28 | | -``` |
29 | | - |
30 | | -*Note:* `wsl_proxy.exe` needs to be somewhere Windows can see it. The binaries however, do not. |
| 22 | +*Note:* The WSL binaries wsl_proxy runs need to be on your path after `.bashrc` is run. |
0 commit comments