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

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

Open
magnusfar opened this issue Nov 10, 2023 · 3 comments

Comments

@magnusfar
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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

  • Just my_aliases.sh does not do the trick.
  • you need a full my_aliases.aliases.sh schema as filenames and then ...
  • reference to it with the part before ....aliases.sh of the mandatory ending ind the aliases array of your .bashrc in order for this to work.

@dulhaver
Copy link
Contributor

#499 should enhance the situation

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

3 participants