Git Product home page Git Product logo

wsl-alias's People

Contributors

hustlahusky avatar leongrdic avatar lesleylai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wsl-alias's Issues

`b` is not recognized, but `b.bat` is.

I find myself in the following situation.

Microsoft Windows [Version 10.0.17134.165]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\...> b
'b' is not recognized as an internal or external command,
operable program or batch file.

C:\...> b.bat
Welcome to wsl-alias! Put your environment variables in ~/.wsl/env.sh

If I move b.bat to another directory that is on my path and outside the WSL file system, it can be found using just 'b'.

I already tried reinstalling a few times.

Did I miss something, or is PATHEXT not applicable to WSL directories (anymore)?

Wrong path

On my Windows, the real path to WSL is C:\Users\micha\AppData\Local\lxss\home\m93a\.wsl, not %localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\m93a\.wsl as your program reports.

Arguments not translated correctly

Hi,

I'm running v2.3 on Windows 10 x64 1803 with Debian installed in WSL and I installed wsl-alias using the provided installer. I've encountered several problems.

I've added an alias for php like this:

C:\Users\Me>b wsl-alias add php php

To verify it really is running from WSL:

C:\Users\Me>php -a
Interactive mode enabled

php > system("uname");
Linux

Running files using a relative path works:

C:\Users\Me>php Documents\Projects\test.php

Using a full path however, does not:

C:\Users\Me>php C:\Users\Me\Documents\Projects\test.php
Could not open input file: C:/Users/Me/Documents/Projects/test.php

Also, some special characters in arguments cause problems. Parantheses will not work:

C:\Users\Me>php -r "exit()"
/bin/bash: -c: line 0: syntax error near unexpected token `('
/bin/bash: -c: line 0: `~/.wsl-alias/wrapper.sh 'C:\\Users\\Me' php -r \"exit()\"'

Semicolons will also cause errors:

C:\Users\Me>php -r "exit;"
/home/me/.wsl-alias/wrapper.sh: eval: line 41: unexpected EOF while looking for matching `"'
/home/me/.wsl-alias/wrapper.sh: eval: line 42: syntax error: unexpected end of file

Let me know if I can be of any help.

EDIT: For clarification, running these commands without wsl-alias using only the native wsl, all special characters work:

C:\Users\Me>wsl php -r "printf('Test(\"Test\");');"
Test("Test");

wsl-alias rewrite

important things to consider:

  • alias .bat files should be in a windows accessible path (most likely /mnt/c - have to find a way to check the default drive)
  • use wslpath to translate the windows path into the unix path
  • remove the privileged user and grant the default user access to mount without password
  • work on string escaping problems

Fall update

since the fall update came out, there are a few things we should update

  • documentation
  • try supporting multiple wsl distros at once (not sure if this is entirely possible)
  • windows aliases (this has been on my list for a while)
  • try to automatically add windows path from the installer

if anyone wants to contribute, I'd appreciate the help

Adding alias with linux path causes syntax error

I might not be doing this properly, but I tried to create an alias to an absolute path to a program and it threw an error.

C:\Users\cjk>b wsl-alias add node /home/offero/.nvm/versions/v8.15.0/bin/node
Unknown regexp modifier "/h" at -e line 1, at end of line
syntax error at -e line 1, near "/."
Execution of -e aborted due to compilation errors.
successfully added

Node is probably not the best example to do this with, but I'm sure there are others.

The install command does not wait for user input

The install script does not wait for user input regarding the default alias:

$ curl -o- https://raw.githubusercontent.com/leongrdic/wsl-alias/master/install.sh | bash
...
Choose a command you'd like to use to call bash from Windows
Command [b]:
The installation has completed!
...

I did not enter an empty line there. (Tried a few times, to be sure.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.