Hot answers tagged

2

The following works with emacs26 on Ubuntu: emacs file --eval "(add-hook 'emacs-startup-hook #'shell)" Adding the function #'shell to emacs-startup-hook (instead of calling it with -f shell) defers the call to shell until the initialization of Emacs is complete. That way the *shell*-buffer will be displayed in the window that is used for the *scratch* ...


2

The problem was in the .inputrc file (vi mode) with the following line: Control-j: history-search-forward As suggested in the jue's comment below, the following solves the problem by restoring the C-j to its original binding for dumb terminals such as the shell mode in Emacs: $if term=dumb Control-j: accept-line $else Control-j: history-search-...


1

Pass the command line option -f to run a function with no arguments, or --eval to run an arbitrary Lisp expression. To run a shell (whichever comes last is the one that's displayed in the Emacs window): emacs filename.txt -f shell emacs -f shell filename.txt Here are examples to split the window or open two frames. emacs -f shell -f split-window-...


Only top voted, non community-wiki answers of a minimum length are eligible