randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.38k stars 84 forks source link

Can't use global aliases (those that are defined in .bash_aliases) in terminus window. #303

Closed shambu09 closed 2 years ago

shambu09 commented 2 years ago

Executing source ~/.bashrc whenever I open terminus solves it. I guess terminus is not sourcing bashrc

randy3k commented 2 years ago

It depends on how you launch your shell. If you launch it with the login flag -l, it should course .bashrc automatically.

shambu09 commented 2 years ago

It depends on how you launch your shell. If you launch it with the login flag -l, it should course .bashrc automatically.

This is the settings file i use

{
"default_config": {
        "linux": "Bash",    // login shell
    },
"shell_configs": [
        {
            "name": "Bash",
            "cmd": ["bash", "-l", "-i"],
            "env": {},
            "enable": true,
            "platforms": ["linux", "osx"]
        }]
}

Correct me if I made some mistake but the aliases don't work although there is a -l arg and yeah the aliases work in normal bash shell.

randy3k commented 2 years ago

How did you source .bash_aliases in .bashrc?

shambu09 commented 2 years ago

I got the solution! The issue was I didn't source .bashrc in .bash_profile. And bash sources .bash_aliases automatically in ubuntu 20.04.

randy3k commented 2 years ago

I think it is because you are running non login shell in other occasion and it sources .bashrc directly.

For login shell, it sources .bash_profile instead and it should include

if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi