Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Dialog is a utility that provides dialog boxes from shell scripts, you may have seen them in aptitude during upgrades. When i use Emacs shell (M-x shell) and type sudo aptitude safe-upgrade, i get the following error several times:

debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline

Why doesn't Dialog work with Emacs shell? And should i use some substitute?

share|improve this question
up vote 5 down vote accepted

Dialog uses ncurses, which doesn't work in Emacs' shell-mode, and according to SO: "What would be a good alternative to ncurses that will work under emacs shell?", there's no suitable alternative to ncurses that would work in emacs-shell, but it hints to full terminal capabilities of other Emacs' modes (which unfortunately I know nothing about), maybe Multi Term?

share|improve this answer
    
I tried to use whiptail, which uses libnewt instead of ncurses, and it said Your terminal lacks the ability to clear the screen or position the cursor. And i don't think multiterm supports ncurses. – Mirzhan Irkegulov Mar 19 '12 at 10:14
    
There's also Ansi Term and EShell, maybe some combination of all these works (I don't know which, sorry). Apparently Ansi Term can run mutt but I couldn't find out if that's linked against ncurses or slang. – sr_ Mar 19 '12 at 10:21
3  
Whether it's linked against ncurses, slang, or just sending out raw terminal directives (the horror), for a full-screen application to run on a terminal, that terminal must understand terminal directives (i.e. it's up to the terminal, not the library), and the OS must have an appropriate termcap/terminfo entry for it. By definition, a dumb terminal is one that doesn't grok terminal directives. Without them, you're limited to outputting characters (including ASCII control chars). No cursor repositioning, character attributes, clearing the screen etc. It's basically an ASR-33. – Alexios Mar 19 '12 at 11:51
    
With a sufficiently new Emacs, M-x term does work with a graphical debconf, but you may need to pull in additional dependencies. Tangentially, see also bugs.launchpad.net/ubuntu/+source/emacs24/+bug/1285864 which suggests installing ncurses-term. – tripleee Jun 29 '15 at 3:45

Actually, emacs has more than one shell. There's a dumb shell which doesn't support full-screen terminal applications, and there is the "Ansi Term", which does. You could even run emacs inside that shell (though running commands inside the window might be more complicated than using emacs in its usual manner).

For example, here is a screenshot of dialog running in a GUI emacs:

screenshot of dialog in ansi-term / GUI

and dialog running in emacs running in xterm:

screenshot of dialog in ansi-term / xterm

Keep in mind that Ansi Term is designed for a specific terminal description, eterm-color — which is not in the Debian ncurses-base package: you would need ncurses-term. Similar caveats apply to any system which defers the complete terminal database to a separate package.

Further reading:

As for the debconf message, google is your friend. Here are some reasonably comprehensive answers:

share|improve this answer

That is a normal message when executing unattended remote commands. Just put this into top of your unattended script :

export DEBIAN_FRONTEND=noninteractive

this will tell scripts you are executing an unattended script so they will know to just do default behaviour ... similar yet more generally applicable to adding the -y flag to some cli input parms

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.