stefan k has asked for the wisdom of the Perl Monks concerning the following question:
I'm currently writing a program that uses the ncurses library. It's use is to show a list of bookmarked directories and/or fast browse thru the filesystem within the console and then print the result to STDOUT. In that way a simple bash-alias like
would enable me to browse my important directories really fast. (OK, the full-featured alias does some parameter passing, too).alias cb='cd `theprog`'
The first version of that script printed the list to STDERR and the result to STDOUT. Worked fine, but not comfy. The second used ANSCI escape sequences and was much more featured. Some day I decided to bloat that little script by using the curses lib, coded many hours and -when I was almost thrugh with the main functionality- I started it with the real alias and ... nothing happened :((
As far as I can see (and the talk in CB showed) you don't have terminal control within the subshell that is opened for the backticks.
I have found that midnight commander has a similar example in it's manpage (description of the -P switch) and they use a tmp-file for that.
Are there any other (more elegant) ways and/or tricks to get a ncurses programm to execute within the backticks?
Thanks and...
| Regards... | Stefan |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NCurses From The Backticks
by bikeNomad (Priest) on Jul 12, 2001 at 20:32 UTC |