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

Using .bashrc #565

Closed
ClementParis016 opened this issue Jul 30, 2015 · 9 comments
Closed

Using .bashrc #565

ClementParis016 opened this issue Jul 30, 2015 · 9 comments

Comments

@ClementParis016
Copy link

I am trying to install thefuck which installation part asks to add a line in .bashrc (or equivalent).

I tried to create this ~/.bashrc file but it doesn't seem to work. Is there any way to make Cmder load the file or maybe there is another .bashrc equivalent specific to Cmder where I could put this command?

@jasonwilliams
Copy link

ive found that Cmder on its own doesn't read your bashrc.
If you run bash then it runs.

But yeah i would be interested in a solution too

@DanielGGordon
Copy link

Is there some sort of file that is read that is similar to /bashrc? For example if I wanted to create some new environment variable.

What tells Cmder to use the aliases in %CMDER_HOME%/config/aliases ?

@rmorrin
Copy link
Contributor

rmorrin commented Aug 25, 2015

@DanielGGordon The vendor/init.bat file is what you are looking for, in particular:

https://github.com/bliker/cmder/blob/master/vendor/init.bat#L50

This is ran each time cmder (or a new tab) launches so I'd avoid putting anything too complex in there though.

@DanielGGordon
Copy link

Ok thanks that is exactly what I was looking for. Just wanted to set some path variables.

@daxgames
Copy link
Member

%USERPROFILE%.bashrc is now sourced and vendor\init.bat is not used for bash in see #702

@thehackercat
Copy link

Can I add some Windows command like set http_proxy=http://10.178.0.84:3128 in vendor/init.bat so I can set http proxy whenever I launch Cmder ?

@daxgames
Copy link
Member

daxgames commented Jul 7, 2017

@thehackercat you don't want to do that because that file is replaced on update of cmder. Create a proxy.bat file in %cmder_root%/config/profile.d with:

set http_proxy=http://10.178.0.84:3128
set https_proxy=http://10.178.0.84:3128
set no_proxy=127.0.0.1,localhost,.....

...... = whatever else you want to bypass proxy.

You can also do a proxy.sh that will be uses by bash

export http_proxy=http://10.178.0.84:3128
export https_proxy=http://10.178.0.84:3128
export no_proxy=127.0.0.1,localhost,.....

@thehackercat
Copy link

@daxgames Thanks, it works!

@jensenr30
Copy link

@jasonwilliams

In order to make Cmder automatically read your .bashrc file, open Cmder.exe and go to:
Settings -> General ->Choose your startup task: {bash::bash}

This way, when cmder starts up, it automatically uses bash, which will read your .bashrc.

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

No branches or pull requests

8 participants