Cmder: Using .bashrc

Created on 30 Jul 2015  路  8Comments  路  Source: cmderdev/cmder

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?

Most helpful comment

@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,.....

All 8 comments

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

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 ?

@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.

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

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

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 ?

@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,.....

@daxgames Thanks, it works!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zsedcbm picture zsedcbm  路  3Comments

AaronKaa picture AaronKaa  路  3Comments

emesx picture emesx  路  3Comments

Joe1992w picture Joe1992w  路  3Comments

giuliannosbrugnera picture giuliannosbrugnera  路  3Comments