This patch does the following:
--- length check for strings should depend on actual string length rather than cursor position
--- fixes cursor movement by mouse clicks for strings that are larger than the output window
--- extends the cl**** to switch to right aligned text