From 2bb70a1c22fe5ee63e7b40aad0a6136dde211aae Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 23 May 2015 16:51:57 -0500 Subject: [PATCH] ANSI: rendering improvements --- phpseclib/File/ANSI.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 5e32ed64..e518f6e5 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -543,7 +543,10 @@ class File_ANSI } $output.= "\r\n"; } - return $output; //rtrim($output); + $output = substr($output, 0, -2); + // close any remaining open tags + $output.= $this->_processCoordinate($last_attr, $this->base_attr_cell, ''); + return rtrim($output); } /** @@ -575,7 +578,10 @@ class File_ANSI } $scrollback.= "\r\n"; } + $base_attr_cell = $this->base_attr_cell; + $this->base_attr_cell = $last_attr; $scrollback.= $this->_getScreen(); + $this->base_attr_cell = $base_attr_cell; return '
' . $scrollback . '
'; }