[lxc-devel] host consoles/ttys in containers

Michael Tokarev mjt at tls.msk.ru
Sat Nov 14 15:35:23 UTC 2009


Michael Tokarev wrote:
>> I noticed that container's consoles aren't quite useable
>> (be it lxc-console or lxc-start with getty bound to /dev/console).
>>
>> The main problem is a complete lack of window resizing support:
>> when I resize an xterm window with lxc-start or lxc-console, the
>> "guest" does not know about that and continues to think that the
>> terminal is 80x25 still.
>>
>> Is it just a lack of functionality (missing implementation) or
>> something problematic?
> 
> Ok, the attached patch fixes this.
> 
> It moves the 'master' variable out of main function so it's
> accessible from the signal handler, sets up SIGWINCH handler
> to call a (newly created) winsz() function that gets the
> current tty size using TIOCGWINSZ ioctl and if that works,
> sets up the pty size using TIOCSWINSZ.  That same function
> is called at the start as well, when setting up the signal
> handler.

According to the CONTRIBUTING document, here it goes:

Signed-Off-By: Michael Tokarev <mjt at tls.msk.ru>

Thanks!

/mjt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lxc-console-winch.diff
Type: text/x-patch
Size: 706 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20091114/6b6dcb83/attachment.bin>


More information about the lxc-devel mailing list