Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

curses on win32

by primus (Scribe)
on Jul 23, 2003 at 15:18 UTC ( [id://277200]=perlquestion: print w/replies, xml ) Need Help??

primus has asked for the wisdom of the Perl Monks concerning the following question:

hey monks,

i cannot seem to get curses working on win32. i am running windows 2000 and have perl 5.8. i found this node which had a link to install a ppd file, but when i ran it... well, it was really messy. i dont know what i did wrong...
ppm install the_file.ppd

is that right/wrong?
i dont know, but it would be nice to get going. thanks monks for the help!

Replies are listed 'Best First'.
Re: curses on win32
by halley (Prior) on Jul 23, 2003 at 15:34 UTC

    Curses is a library of useful text terminal screen manipulation primitives like "scroll this rectangle upward" or "fill this rectangle with blue."

    In turn, the curses features depend on intimately knowing the special character sequences you can send to the terminal to implement these results. Terminal sequences are usually somewhat simpler: "adopt a new text color" for subsequent output, "move the cursor" to a given location.

    On Unix systems, it's likely going to rely on the Termcap library to get a series of escape character sequences. On DOS-based systems, it probably assumes that since Termcap doesn't exist, it should rely on ANSI escape character sequences. DOS used to offer an optional ANSI.SYS device driver that would recognize and implement the terminal features.

    The perl module you've installed implements Curses features. It is probably spitting out ANSI sequences. Of course, if you don't have any ANSI.SYS (or equivalent) installed, it looks really noisy. The cursor doesn't get moved, the screen areas don't get colored, the sequences overwrite each other and the rest of the program output.

    You need an ANSI.SYS sort of driver loaded. Google is your friend.

    --
    [ e d @ h a l l e y . c c ]

      well, i found that i had the ansi.sys file in C:\WINNT\system32\, so i added that to my config.sys like so:
      device=C:\WINNT\system32\ansi.sys

      this really didnt seem to do anything, but i rebooted the computer, and tried the curses.ppd again.

      and again, i got the mess of symbols when i tried to run the ppd file... did i do something wrong?

      thanks
        When I said that "Google is your friend," I was suggesting you try searching for some published help regarding ANSI.SYS and Windows. DOS and Windows 95 work differently from Windows 2000. I don't know Windows XP differences because I don't use Microsoft products these days.

        This link, listed on the first google results page, appears useful. http://is-it-true.org/nt/utips/utips181.shtml

        --
        [ e d @ h a l l e y . c c ]

      i tried the website, and i think it worked, loading the ansi.sys, but when i ran the ppd file from the prompt, i got the same garbles symbols and beeps.
      i dont know if something is wrong with the ppd or what...
      thanks for the help

        ANSI.SYS does not work in CMD.EXE sessions, only COMMMAND.COM sessions, which you can run under NT/2000/XP, but are less than useful. (** Severe understatement!)

        The only way I have found to use ansi escape sequences in conjuction with CMD sessions is Win32::Console::ANSI which overrides several built-ins and selects a tied handle in place of STDOUT, and then implements the ANSI sequences using Win32 native console functions.

        Whether this would coexist with the curses package I'm not sure, but it would be worth a try.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller

      ... i even tried to extract the tgz file from that website with the ppd, and copy the files manually into the perl/site/lib directory.

      that didnt work... i get an error "TIESCALAR called with too few arguments line 85 of Curses.pm" when i say "use Curses" ... ! i dont know why that is happening.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://277200]
Approved by halley
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found