virsh console and tty size

Solution 1:

You could mostly work around this problem in the shell.

The command:

eval `/usr/bin/resize`

will set the COLUMNS and LINES shell variables appropriately and then export them. So in bash, you could add the following to your .bash_profile (or .profile, depending on which you use)

PROMPT_COMMAND="eval `/usr/bin/resize`"

Or in zsh:

function precmd {
    eval `/usr/bin/resize`
}

So that a resize would be performed right before each prompt was displayed. The effect wouldn't be like that of ssh or telnet where the window changes would be handled immediately as a result, however I think this is probably the best you'll get.

Solution 2:

Telnet and SSH has an out of band channel to configure these settings. Serial interface does not. See: http://tools.ietf.org/html/rfc1073 and http://tools.ietf.org/html/rfc4254#page-14