urxvt leaving ncurses content drawn on screen detach


For a while now I've had this issue with urxvt, when I detach screen the terminal remains garbled with the content the screen had before I detached. This, I guess, is because there is something funny going on in urxvt's terminfo. As a workaround one can fake urxvt being actually rxvt by defining termName in ~/.Xdefaults:

urxvt*termName: rxvt-256color


urxvt*termName: rxvt

or whatever. The terminal acts nicely with screen and ncurses, and I haven't run into any problems thus far. But note that generally speaking lying about your terminal's capabilities is a stupid idea.