Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When booting FreeBSD (I use 8.4-amd64) in single-user mode, mounting root filesystem in read/write mode and trying to vi some text file, I get all of this file's contents in one line. This makes vi unable to edit text configs.

When running multi-user, all works OK.

How can I fix this?

share|improve this question
up vote 2 down vote accepted

It's because not all config files are read during boot in single-user mode.

In this particular case the problem is in the TERM environment variable not being set properly. To fix this, just type

export TERM=xterm

and vi will work fine until you reboot again.

share|improve this answer
Colleagues also say they encountered cases with FreeBSD 8.4 when setting TERM=xterm didn't helped to solve the problem, but setting TERM=vt100 did. – AntonioK Jul 14 '14 at 10:03
vt220 should work as well. – schaiba Dec 15 '15 at 7:20

Your Answer


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.