ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

Custom aliases not overwriting defaults when opening new instance of shell (Git Bash) #494

Open magnusfar opened 7 months ago

magnusfar commented 7 months ago

Running ll uses the default.

$ alias ll
alias ll='ls -lAFh'

I then run the following, which makes it work properly.

$ source ~/.oh-my-bash/custom/aliases/example.aliases.sh
$ alias ll
alias ll='ls -lAhtrF --group-directories-first'

My .bashrc does source "$OSH"/oh-my-bash.sh, which again should load and overwrite custom settings over default oh-my-bash settings. However, when I start a new instance of Windows' Terminal (or simply a new tab within) running Git Bash it does not automatically source and overwrite my custom alias. Why does it not work?

akinomyoga commented 7 months ago

My .bashrc does source "$OSH"/oh-my-bash.sh, which again should load and overwrite

Did you add example in the array aliases in your .bashrc? You need to add example in the arrray aliases in your .bashrc to enable example.aliases.sh.

dulhaver commented 7 months ago

@akinomyoga: "Did you add example in the array aliases in your .bashrc? You need to add example in the arrray aliases in your .bashrc to enable example.aliases.sh."

this is indeed to way to do it. It is however very much not intuitive on how to practically do that.

I guess most people will not use the example.aliases.sh but put their own files in there.

If that is what you are doing you have to exactly use the exact naming schema of examples.aliases.sh for such files.

dulhaver commented 7 months ago

https://github.com/ohmybash/oh-my-bash/pull/499 should enhance the situation