execute
execute copied to clipboard
Alias is not being executed
Hi,
thanks for this crate, I was trying to use it for the atuin shell history, but it seems aliases from the shell config are not respected.
Or am I missing some point in the docs?
It seems that alias does not work in a non-interactive shell. According to https://stackoverflow.com/questions/1615877/why-aliases-in-a-non-interactive-bash-shell-do-not-work, you can run shopt -s expand_aliases to enable it.
- Create a bash file (assuming your shell is bash)
#!/bin/bash shopt -s expand_aliases # you can add your alias here - Set the
BASH_ENVenvironment variable to the path of the bash file. - Now you can use alias commands in a non-interactive shell.
Thanks for the quick answer and good find on that stackexchange article.
Bummer side of this: atuin has support for bash, zsh, fish and nushell at the moment.
Do you think adding alias expansion as a feature (returning some error like "Alias expansion not supported for <SHELL>") would be realistic to who's for? Tbh I haven't had any looks at your code base so far at all, so I have no idea if you already are doing stuff for specific shells.
Assuming you are using bash, you can use bash -i -c "<Your Command> to execute a command in an interactive shell. I'm not planing to provide API for interactive/login shell because Windows has no such thing.