Bash – Freebsd doesn’t show command output correctly in Putty

bashfreebsdputtyxterm

I have just installed the latest stable version of FreeBSD to a computer and I have the following problem:

If, in Putty, I issue a command like ps uxa which gives long lines of output, they get cropped. ps uxa|more doesn't help. Even if I do ps uxa > file.txt, lines are cropped to 80 chars in the file!

There are some images of how it looks like:
http://yfrog.com/0rfilecroppx

This happens right after clean installation, with everything set to default. Default shell is csh, changing it to bash didn't help. This has never happened to me in Linux.

My uname -a

FreeBSD freebsd.localdomain 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009
root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

How to fix this problem? I have already looked at env vars, .profile, .cshrc, /etc/login.conf.

Best Answer

Try using the -w option:

From the MAN page:

 -w      Use 132 columns to display information, instead of the default which is your
         window size.  If the -w option is specified more than once, ps will use as
         many columns as necessary without regard for your window size.  When output
         is not to a terminal, an unlimited number of columns are always used.