When I use
shell-mode, by default company seems to pull candidates from tokens in open buffers. How can I set up the backend to get candidates from shell commands, directory names, and file names? Googling "company-shell" returns somewhat oily results.
company-backends specifies in what backends to try out in which order. The first backend signaling that it can deliver candidates (based on the current input) is used.
To make use of the current major mode's built-in completion facility (as can be used by
M-TAB in code/text and
TAB in interactive modes), use the new
company-capf backend. It should be put as the very first one in more recent installations and can be made use of in at least Emacs 24.4. You can check which backend is used currently by inspecting the modeline lighter.