[dev] [st] [patch] Correctly initialize altscreen when defaultbg is not 0.

From: Mark Edgar <medgar123_AT_gmail.com>
Date: Mon, 26 Aug 2013 00:10:47 +0200

The alternate screen is not properly initialized when st starts. To see
this, set defaultbg in config.h to anything other than 0 (for example, swap
defaultfg and defaultbg), and run:

./st -e sh -c 'tput smcup; read'

You should see that the top-left 80x24 rectangle is black (or whatever
colorname[0] is), while the rest of the screen (if any) has the desired
colorname[defaultbg] color.

The attached patch fixes this by initializing term.c.attr in tnew() before
calling tresize(). It also removes the unnecessary xcalloc() calls, which
misled me on this bug hunt since it is really tclearregion() which
initializes term.lines and term.alt in tresize().

Thanks for convincing me to try st. :)

     -Mark

Received on Mon Aug 26 2013 - 00:10:47 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 26 2013 - 00:12:23 CEST