* Term as a login shell
@ 2019-07-15 12:22 Ergus via help-gnu-emacs
2019-07-15 14:12 ` Robert Pluim
0 siblings, 1 reply; 2+ messages in thread
From: Ergus via help-gnu-emacs @ 2019-07-15 12:22 UTC (permalink / raw)
To: help-gnu-emacs
Hi:
I am using term, but some of my functionalities require the shell to be
a login shell (to use lmod for example).
Usually we do that by passing the option `--login' to the shell command,
what's the proper way to start the normal `term' as a login shell by
default?. An option I don't find in the manual maybe?
multi-term has a variable called multi-term-program-switches, but I
don't use multi-term.
Any suggestion?
Thanks in advance
Ergus
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Term as a login shell
2019-07-15 12:22 Term as a login shell Ergus via help-gnu-emacs
@ 2019-07-15 14:12 ` Robert Pluim
0 siblings, 0 replies; 2+ messages in thread
From: Robert Pluim @ 2019-07-15 14:12 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: Ergus
>>>>> On Mon, 15 Jul 2019 14:22:40 +0200, Ergus via help-gnu-emacs <help-gnu-emacs@gnu.org> said:
Ergus> Hi:
Ergus> I am using term, but some of my functionalities require the shell to be
Ergus> a login shell (to use lmod for example).
Ergus> Usually we do that by passing the option `--login' to the shell command,
Ergus> what's the proper way to start the normal `term' as a login shell by
Ergus> default?. An option I don't find in the manual maybe?
Ergus> multi-term has a variable called multi-term-program-switches, but I
Ergus> don't use multi-term.
Term doesnʼt have a user option for that, but itʼs easy enough to come
up with a variant of `term' that does the right thing:
(defun term-login (program)
(interactive (list (read-from-minibuffer "Run program: "
(or explicit-shell-file-name
(getenv "ESHELL")
shell-file-name))))
(set-buffer (make-term "terminal" program nil "--login"))
(term-mode)
(term-char-mode)
(switch-to-buffer "*terminal*"))
You can M-x report-emacs-bug to request that it be possible to either
specify a default set of switches to use, or that `term' be taught to
prompt for switches if called with a prefix argument or similar.
Robert
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-15 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-15 12:22 Term as a login shell Ergus via help-gnu-emacs
2019-07-15 14:12 ` Robert Pluim
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.