2

I want to use /bin/bash as default shell for term avoiding it to ask me every time.

Is this possible?

1
  • n.b. It needn't be a shell at all. You can run anything in a terminal. Your preferred shell is just provided as a convenient default, because most of the time people do want to run a shell.
    – phils
    Apr 6 at 23:46
3

There doesn't appear to be a way to tell Emacs to use a default shell for term. However, when you call the term function from elisp code, you can specify the terminal program to use.

To use this, add the following to your configuration:

(defun my-term ()
  (interactive)
  (term "/bin/bash"))

This defines a new command, which you can call as M-x my-term. You can change it to any name you like, as long as it doesn't conflict with an existing command name.

(You could also use advice to change the way M-x term behaves, but that requires a bit more care to make sure you don't make problems for yourself)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.