I have a few custom bash functions that are defined is some file and are made available to me in regular terminals via the line
. "/path/Custom Bash Functions.sh"
in my ~/.bashrc. However, Emacs does not recognize them.
I don't really care whether they are available in any terminal emulator inside Emacs. I only care about them working when I hit M-!.
This answer suggests setting shell-command-switch to "-ic" (adding switch i to the default). However, all this seemingly results in is that the output of all commands I execute via M-! are preceded by:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
I still can't execute custom bash functions. Auto-complete for them doesn't work either.
Maybe this is because I use a newer version. I use the latest version on the master branch of Emacs' git repo (pulled the latest changes and installed them less than 2 hours ago).
-idoes is to source~/.bashrc(assuming you use/bin/bashas your shell). So you can put your custom functions in that file, or source your custom functions file from there. That's probably a good idea so you can have your custom functions in a shell without having to source it explicitly every time. The complaints that bash issues however in the-icase probably arise from how emacs sets up the process and probably cannot be avoided.-ishould work. Try adding-ixand post the complete output, preferably with a shorter.bashrcthat reproduces the problem..bashrcwas messing with what I tried to do. Anyway, it works now. However, there still is no auto-complete. I have to type out the entire command. Should auto-complete work? I tested it withemacs -Qand it behaves in the same way: The command works (after evaluating(setq shell-command-switch "-ic")) but it's not auto-completed when I hit <kbd>Tab</kbd>.iswitch.