Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /nix_tools 0 option to init.bat to prevent adding !GIT_INSTALL_ROOT!\usr\bin to PATH #1975

Merged
merged 1 commit into from
Dec 14, 2018

Conversation

patstew
Copy link
Contributor

@patstew patstew commented Dec 3, 2018

Adding all the unix tools to the path prevents some programs (Vivado) from working for me.

@daxgames
Copy link
Member

daxgames commented Dec 3, 2018

I'm not sure about this feature. If you don't want *nix tools why not use cmder_mini.

@daxgames
Copy link
Member

daxgames commented Dec 3, 2018

or add whatever path unix tools are conflicting with to the front of the path in your user_profile.cmd

@daxgames
Copy link
Member

daxgames commented Dec 3, 2018

or remove the unix tools from the path using youe user_profile.cmd

@patstew
Copy link
Contributor Author

patstew commented Dec 3, 2018

I am using cmder_mini, but cmder still picks up my git for windows installation. I like having the git prompt integration etc, and want 'git' on the path, but having 'sh' anywhere on the path causes problems for me (The presence of sh causes shell scripts to be run instead of .bat files). I'd rather just maintain my own init.bat with that line commented than write a script to edit the PATH afterwards, and I want it to be optional per shell. Git for windows offers 2 options for path integration when you install, with and without the unix tools, I assume because they know it can be a problem (not just one that affects me).

@daxgames
Copy link
Member

I understand. I am working on a switch to /prefer_nix that adds *nix commands to the front of the path vs. the default of adding to the end of the path. This is how Cmder used to setup the path and users have requested *nix tool preference.

FWIW you can do this today with existing conditional call features in Cmder and init.bat:

  1. Clone a Conemu Cmder task, call it Cmder No Unix Tools
  2. Add /no_nix to the command line.
  3. Create a %cmder_root%\bin\no_nix.bat file with:
set path=%PATH:C:\Users\user\cmderdev\vendor\git-for-windows\usr\bin;=%
  1. Edit %cmder_root%\config\user_profile.cmd and add.
%ccall% /no_nix no_nix

@daxgames
Copy link
Member

@patstew A clarification. I just want to make sure your change works with mine before merging.

vendor/init.bat Outdated Show resolved Hide resolved
vendor/init.bat Outdated Show resolved Hide resolved
vendor/init.bat Outdated Show resolved Hide resolved
Copy link
Member

@daxgames daxgames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments to allow sharing a single arg to modify this behavior. I will then merge and add my changes to allow preference of the *nix tools over windows tools.

@daxgames
Copy link
Member

daxgames commented Dec 14, 2018

👍 LGTM - Thanks for the changes.

@daxgames
Copy link
Member

@Stanzilla - You want to look. I tested it and it works.

@Stanzilla
Copy link
Member

LGTM!

@daxgames daxgames merged commit 25820ae into cmderdev:master Dec 14, 2018
@daxgames daxgames changed the title Add /git_no_unix switch to init.bat to prevent adding !GIT_INSTALL_ROOT!\usr\bin to PATH Add /nix_tools 0 option to init.bat to prevent adding !GIT_INSTALL_ROOT!\usr\bin to PATH Dec 22, 2018
@daxgames
Copy link
Member

daxgames commented Jan 7, 2020

@patstew you have any issues with #2222 that implements /nix_tools 0 should prevent adding !GIT_INSTALL_ROOT!\mingw64\bin to PATH #2214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants