Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Curses-based applications?

by sedusedan (Monk)
on Oct 27, 2013 at 17:32 UTC ( #1059926=perlquestion: print w/replies, xml ) Need Help??
sedusedan has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to write a curses-based application to run under Linux. Can anyone suggest more curses-based Perl applications aside from the ones I found on CPAN and listed below? Seems like there are not too many of these, which is quite disappointing.

  • App::Syndicator - A simple RSS fetcher and reader. So far the only rather usable app I can actually use.
  • App::PassManager - A password keeper. The concept is simple and the app could be rather useful, but it has minor UI bugs like off-by-one errors when displaying items, or visual update bugs that turned me off.
  • Config::Model::CursesUI] - Didn't try this one out because the Synopsis doesn't give a sample I can just copy-paste and run.
  • Stackato::Stackrad - ran this and looked around, the app uses a notebook/tab interface and looks quite nice. Didn't try further because I don't use Stackato.
  • Socialtext::Wikrad - server doesn't seem to accept my user/pass.
  • CPANPLUS::Shell::Curses - Unmaintained, no longer runs due to a non-existing module.

All of the above use Curses::UI, the most popular module used to build curses-based application. The other one, Curses::Toolkit, is newer and claims to be the modern alternative but is still in beta and doesn't have as many examples/documentation/widgets. Yet another one, Cdk (Curses-Devkit) while still on CPAN/Debian is long dead, fails on CPANTesters, and no other CPAN modules are using it.

In fact the whole situation with curses and Perl doesn't look too convincing. Lots of things don't seem to work or are buggy. Curses::UI::Grid's demo shows UI defects and spew substr() warnings. In the Curses::UI demo for multilanguage languages like Chinese don't work (my terminal & environment does support Chinese). The colors look atrocious. The demos for Curses::Toolkit look worse: Shift-Tab doesn't work, scroll area cannot be scrolled with keyboard, response to mouse clicks is slow (actually even typing into an input box feels very sluggish).

Should I just give up and look elsewhere for curses? Python seems to be used a lot by RedHat and Debian for this kind of tasks. I'm still trying to use Perl though. Perl is usually great at solving my problems, but for this I feel like I'm thrown *far before* the DOS/Turbo Pascal/Turbo Vision days. Why are we so backwards when it comes to TUI?

Update 2013-11-06: Someone mentioned Tickit on my blog, I actually bookmarked that module a few months ago but forgot about it. It does not use the curses library and looks quite promising. The code is quite clean and simple and modern, the author is active/maintaining, and it looks like it has quite a lot of features (multiple/overlapping windows, lots of widgets). But there is no application on CPAN using it yet.

Also someone reminded me about Inline::Python where you can in theory use many Python modules through Perl. I haven't explored this route further.

As I said also on the comment, dialog(1) is another simple alternative. Its form support is rather limited though.

Replies are listed 'Best First'.
Re: Curses-based applications?
by Anonymous Monk on Oct 28, 2013 at 07:17 UTC
      Thanks, I've tried several 'cme edit' commands like 'cme edit fstab'. Seems to work and decent enough. Although the app itself says "You should install Config::Model::TkUI for a more friendly user interface".
Re: Curses-based applications?
by sedusedan (Monk) on Oct 29, 2013 at 15:11 UTC

    Speaking of Turbo Vision, another option would be to turn to one of the Linux ports of it. Though one would have to write a Perl binding for it first. Python has Perl beat here by having a binding: PyTVision, but I suspect it's no longer working (last updated in 2004). Being an old and DOS-based project (it was first released by Borland in 1992), Turbo Vision probably has zero or near-zero support for Unicode/wide characters.

    I'm seriously considering dialog(1) now.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1059926]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2018-05-26 22:01 GMT
Find Nodes?
    Voting Booth?