JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Correctly initialize altscreen when defaultbg is not 0.
authorMark Edgar <medgar123@gmail.com>
Sun, 25 Aug 2013 22:10:47 +0000 (00:10 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Wed, 4 Sep 2013 16:33:02 +0000 (18:33 +0200)
commit4245ba0d12a330b3e54c6498e88024d90956ae34
tree843d42fca2260a2e2426715a15c9928f85ce6f93
parentf3d438b1015a031bc543bb2d65c81cc2329787d4
Correctly initialize altscreen when defaultbg is not 0.

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().
config.def.h
st.c