4

Googling, I can only find how to switch between these two, but no description of what they are.

So, what is char-mode and line-mode? And what mode are usually regular shells in?

6

As in the page you linked:

In line mode, Term basically acts like Shell mode (see Shell Mode). In char mode, each character is sent directly to the subshell, except for the Term escape character, normally C-c.

In line mode, it reads an entire line and permits various emacs editing operations on it, then sends it to the process all at once when you're done (press Enter). In char mode, each character is sent through as soon as you press the key - dealing with lines, editing, and so on is up to the process running in the terminal, such as your shell.

Why might you want to use one over the other? Line mode allows you to perform Emacs editing operations on what you write, to accumulate multiple lines to send through at once, and to perform tab completion of filenames in Emacs. See the list of commands in shell mode for details. Character mode lets you use all the features of the underlying process, like its own (likely better) tab completion, rather than the Emacs operations, and also to send through inputs that Emacs would have interpreted as referring to its own commands (like Ctrl-X). This is also the mode you'd want if you wanted to run vim inside emacs.

An ordinary terminal operates in the equivalent of character mode.

  • This must be why my ipython was acting so funny in emacs. Thanks! – The Unfun Cat Aug 6 '14 at 3:39

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.