These two patches address a couple of issues I found when trying to use kdb from a vga+kbd session. Both are related to custom-defined commands and the LINES environment variable.
[PATCH 1/2] KDB: Make LINES an internal variable. [PATCH 2/2] KDB: Overide LINES for custom commands.