diff --git a/src/sbbs3/con_out.cpp b/src/sbbs3/con_out.cpp
index db9b07ae48cc4ecd26db797a9ac1d39c412752bd..6ab6c1954972e69c9c288b092501dc7be7e9b398 100644
--- a/src/sbbs3/con_out.cpp
+++ b/src/sbbs3/con_out.cpp
@@ -239,17 +239,26 @@ void sbbs_t::outchar(char ch)
 	if(!outchar_esc) {
 		if((uchar)ch>=' ')
 			column++;
-		else if(ch=='\r')
+		else if(ch=='\r') {
+			lastlinelen = column;
 			column=0;
+		}
 		else if(ch=='\b') {
 			if(column)
 				column--;
 		}
+		else if(ch=='\t') {
+			column++;
+			while(column%8)
+				column++;
+		}
 	}
 	if(ch==LF || column>=cols) {
-		lncntr++;
+		if(lncntr || lastlinelen)
+			lncntr++;
 		lbuflen=0;
 		tos=0;
+		lastlinelen = column;
 		column=0;
 	} else if(ch==FF) {
 		lncntr=0;
diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index d8e57ac1d6a159ba2d49f28cd529261ed0db33d6..7348750e41db5f3b9d8681a39fee51ce6a045026 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -3155,6 +3155,7 @@ sbbs_t::sbbs_t(ushort node_num, union xp_sockaddr *addr, size_t addr_len, const
 
 	sys_status=lncntr=tos=criterrs=slcnt=0L;
 	column=0;
+	lastlinelen=0;
 	curatr=LIGHTGRAY;
 	attr_sp=0;	/* attribute stack pointer */
 	errorlevel=0;
diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h
index da1b1e7ff60a7ef11f67a0122c0333a803a58f48..d9b0dad0df3b9e7c5612686cd4aea4b0e545f3e2 100644
--- a/src/sbbs3/sbbs.h
+++ b/src/sbbs3/sbbs.h
@@ -451,6 +451,7 @@ public:
 	long 	rows;			/* Current number of Rows for User */
 	long	cols;			/* Current number of Columns for User */
 	long	column;			/* Current column counter (for line counter) */
+	long	lastlinelen;	/* The previously displayed line length */
 	long 	autoterm;		/* Autodetected terminal type */
 	char 	slbuf[SAVE_LINES][LINE_BUFSIZE+1]; /* Saved for redisplay */
 	char 	slatr[SAVE_LINES];	/* Starting attribute of each line */