New newt terminal plugin
I've added a newt terminal plugin to trunk, which I'd like to start
using in a couple of places for squeeze, allowing us to fix #378706
(manual package selection) and #412168 (rescue mode trouble with
TERM=bterm). This also required exporting a few fairly trivial extra
interfaces from the cdebconf newt frontend.
I'll quote a block comment from newt-plugin-terminal.c, in case people
are wondering how a terminal plugin for newt makes any sense:
/* But we already have a terminal!
* Well, not quite. Firstly, we have to disconnect from debconf (which isn't
* too hard; the debconf-disconnect utility in di-utils does it, although in
* a cdebconf plugin there's no need for this since our standard file
* descriptors are already as desired). Secondly, the terminal type is
* "bterm", which the installed system doesn't know about; this causes some
* inconveniences. These problems can more or less be handled outside
* cdebconf if all we need is to start a shell.
* Much more significantly, though, newt is probably already displaying a
* window. In order to do a good enough job to be able to run a full-screen
* curses application such as aptitude, we need to tell it to tear
* everything down, and then we need to put it all back so that it doesn't
* look dreadful when we exit (particularly if e.g. a progress bar is being
I've tested this in a normal system with a test script that displays a
progress bar and then starts aptitude in a terminal plugin, and it all
works beautifully. I have yet to manage to do a straight-through test in
an installer because I only just got all the bits working (it was a lot
faster to test it in a normal system), but I intend to do that first
thing next week. The calling sequence looks basically the same as GTK's
terminal plugin, so the same sorts of things as you see in
debian-installer-utils/start-shell will work.
Note that the process you ask for is started as a child of cdebconf, not
as a child of the confmodule, so you'll have to be careful to transfer
over any environment variables you need. And, of course, this is
arbitrary command execution, so you'd better not put cdebconf with this
plugin on a security boundary - but you weren't mad enough to do that
anyway, were you?
[This work was sponsored by Canonical Ltd., hence the use of my Ubuntu
Colin Watson [firstname.lastname@example.org]