Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 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

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.