1

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

aaronjg
  • 757
  • 5
  • 15
  • I sometimes have this problem if I'm using xterm (which you are) and I adjust the width of the window using the mouse. I assume because xterm can't figure that out correctly all the time. – drysdam May 03 '11 at 16:51
  • drysdam: I tried resizing the window, and it unfortunately did not help. – aaronjg May 07 '11 at 21:58

3 Answers3

1

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)))))
Ivan Andrus
  • 5,221
  • 24
  • 31
Chris
  • 46
  • 1
0

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)
Rörd
  • 6,556
  • 21
  • 27
  • I tried toggling truncate line mode, and it didn't help. The weird thing is it seems completely dependent on the fringe being absent. – aaronjg May 07 '11 at 21:57
0

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.

dmckee --- ex-moderator kitten
  • 98,632
  • 24
  • 142
  • 234
  • That also didn't seem to work. I get the same results as before, where the line is just wrapped over on itself. – aaronjg Jun 15 '11 at 18:39
  • @aaronjg: Ah...in a normal terminal I would be suspicious of your TERM variable. Try `printenv TERM` *in the emacs shell*, then try googling with the result and "emacs" and "wrap". Might get somewhere. – dmckee --- ex-moderator kitten Jun 15 '11 at 18:50