mprocs icon indicating copy to clipboard operation
mprocs copied to clipboard

Bash aliases

Open diego-rapoport opened this issue 2 years ago • 6 comments

When I try to run a bash alias it just can't find it. Is there a way to configure it or it has to be implemented? Could be an interesting feature.

diego-rapoport avatar Jun 23 '22 14:06 diego-rapoport

Do you face the issue if you use shell. Eg:

procs:
    my-cmd:
       shell: "myalias"

psibi avatar Jun 23 '22 14:06 psibi

Yes I do. My shell is configured to be bash, not sh as I saw it tries to run when I use cmd.

diego-rapoport avatar Jun 23 '22 14:06 diego-rapoport

I don't really know a good way to run bash with a command and load the default config before that command. I tried calling "zsh -c my-alias", but that doesn't have aliases from my .zshrc. Maybe bash has some arguments to load default config.

pvolok avatar Jun 23 '22 15:06 pvolok

So, what I've discovered is that my env $SHELL is set as bash but mprocs is using sh. The output of echo $0 is indeed sh as mprocs output.

diego-rapoport avatar Jun 23 '22 15:06 diego-rapoport

So I've managed to make it work using bash -i -c my_alias in shell from config, but wish I shouldn't.

diego-rapoport avatar Jun 23 '22 17:06 diego-rapoport

So I've managed to make it work using bash -i -c my_alias in shell from config, but wish I shouldn't.

This is the only reasonable way to achieve that. Aliases don't exists outside bash and can't be called outside of bash. The -i is also necessary because, I presume, your aliases are defined in your bashrc.

fstamour avatar Oct 06 '22 17:10 fstamour