Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Just wondering if there is any way to put emacs and shell in the same window. Like split the shell in to two parts, one for shell it self, the other one for emacs. Or is there any way to switch the shell window and emacs window quickly?

The reason I am asking this is: sometimes I need to run my program with shell command, that I have to close the emacs and go back to the shell window. It is a little waste of time to switch back and forth.

Thank you

share|improve this question

migrated from stackoverflow.com Sep 12 '12 at 23:43

This question came from our site for professional and enthusiast programmers.

2  
unix.stackexchange.com/questions/7453/… –  Nykakin Sep 11 '12 at 15:31
3  
You can't just use M-x shell from within emacs? –  Jon Lin Sep 11 '12 at 15:31
add comment

3 Answers

up vote 1 down vote accepted

You are after what is called a terminal multiplexer. The two most commonly used are screen and tmux. tmux has more features and you should favor it over screen if you have a choice.

share|improve this answer
add comment

You can always use terminal inside emacs (emacs will do all the painting). Generally you have 3 choices:

  • shell mode - terminal is just another emacs buffer, you can't use utils which require curses or similar libraries (man won't probably work, as well as top or finch),

  • eshell mode - i haven't used it much. It's builtin emacs shell on top of lisp.

  • ansi-term mode - emulates ansi terminal, can work in two modes. You can run man, htop etc., there are some issues, but im quite sure you'll be happy with it. These modes are:

    • character mode - it will grab almost all your emacs bindings, to switch use C-x C-j
    • line wrap mode - it will behave like another buffer, to switch back use C-x C-k.
share|improve this answer
add comment

You can always just suspend emacs (M-x suspend-emacs), run your command, then return to emacs (fg).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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