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?

1 Answer 1


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.

  • 1
    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, 2014 at 10:03
  • vt220 should work as well.
    – schaiba
    Dec 15, 2015 at 7:20

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.