Question

When I run term mode in emacs GUI, I have issues with line wrapping. It runs fine when I am running emacs in xterm. When there is an output that has a very long line, it is all displayed on the same line, with my prompt. When I launch emacs in xterm, and then go to term mode, it behaves properly, wrapping the long line.

I run:

aaronjg@aaronjg-desk:~$ echo $PATH

and get.

aaronjg@aaronjg-desk:~$ usr/bin:/sbin:/bin:/usr/games:/home/aaronjg/kde/bin:/usr

Was it helpful?

Solution

Put this in .emacs:

(setq overflow-newline-into-fringe nil)

Here's where it comes into play in term.el:

(defun term-window-width ()
  (if (featurep 'xemacs)
      (1- (window-width))
    (if (and window-system overflow-newline-into-fringe)
        (window-width)
      (1- (window-width)))))

OTHER TIPS

The main variable to control that behaviour in Emacs is truncate-lines. Check its value. Maybe you have a configuration file that sets it to true. In that case you should be able to change that by adding this to your personal configuration file:

(set-default truncate-lines nil)

To cause emacs to "wrap" lines as you type you have a couple of choices:

  • Turn on auto-fill-mode (a minor mode) use M-x auto-fill-mode which will hard wrap your lines. Wrapping is controlled by the value of the current-fill-column variable

  • Turn on longlines mode (also a minor mode) with M-x longlines-mode which will soft wrap you lines. Here wrapping is controled by the variable fill-column, and there are other interesting features such as hard-newline exposure under the control of longlines-show-hard-newlines.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top