72

Are there any ncurses libraries in C/C++ for Windows that emulate ncurses in native resizable Win32 windows (not in console mode)?

Michael Mrozek
  • 169,610
  • 28
  • 168
  • 175
gio
  • 883
  • 2
  • 8
  • 12
  • 2
    Do you know of [PDCurses](http://pdcurses.sourceforge.net/)? It's an implementation of the curses library for Windows. Is this not what you're looking for? What do you mean by console mode? – nnyby Sep 15 '09 at 10:44
  • I use PDCurses, and though the doc claims you can resize the window, I have not been able to do it. You are limited by the settings of the console window. – EvilTeach Mar 08 '10 at 20:29
  • EvilTeach you can resize the window with PDCurses, check out the testcurs.c in the demos of PDCurses, it demonstrates that effect. – Bach Jun 16 '10 at 12:45
  • [ncurses 5.8 (2011)](https://invisible-island.net/ncurses/announce-5.8.html) added a port to MinGW. – Thomas Dickey Jul 17 '20 at 19:31
  • 1
    Does any curses library work with the new Windows Terminal now? – Lothar Jan 19 '22 at 00:09

2 Answers2

38

There's an ongoing effort for a PDCurses port:

http://www.mail-archive.com/pdcurses-l@lightlink.com/msg00129.html

http://www.projectpluto.com/win32a.htm

wbruna
  • 416
  • 4
  • 2
  • 1
    This is what I was looking for. The win32a project is in the right direction. I have spoken with the developer and there is a chance to see this implementation as part of the PDCurses at some point. – gio Sep 28 '10 at 20:30
  • 2
    On Github: https://github.com/Bill-Gray/PDCursesMod – Andrew May 02 '21 at 02:03
18

Such a thing probably does not exist "as-is". It doesn't really exist on Linux or other UNIX-like operating systems either though.

ncurses is only a library that helps you manage interactions with the underlying terminal environment. But it doesn't provide a terminal emulator itself.

The thing that actually displays stuff on the screen (which in your requirement is listed as "native resizable win32 windows") is usually called a Terminal Emulator. If you don't like the one that comes with Windows (you aren't alone; no person on Earth does) there are a few alternatives. There is Console, which in my experience works sometimes and appears to just wrap an underlying Windows terminal emulator (I don't know for sure, but I'm guessing, since there is a menu option to actually get access to that underlying terminal emulator, and sure enough an old crusty Windows/DOS box appears which mirrors everything in the Console window).

A better option

Another option, which may be more appealing is puttycyg. It hooks in to Putty (which, coming from a Linux background, is pretty close to what I'm used to, and free) but actually accesses an underlying cygwin instead of the Windows command interpreter (CMD.EXE). So you get all the benefits of Putty's awesome terminal emulator, as well as nice ncurses (and many other) libraries provided by cygwin. Add a couple command line arguments to the Shortcut that launches Putty (or the Batch file) and your app can be automatically launched without going through Putty's UI.

scooter-dangle
  • 115
  • 3
  • 9
Adam Batkin
  • 51,711
  • 9
  • 123
  • 115
  • 2
    Unfortunately puttycyg was discontinued. Personally, I recommend [Cygwin/X](http://x.cygwin.com/) combined with [Cygwin Ports](https://sourceware.org/cygwinports/), using the quite comfortable RoxTerm terminal emulator. – DevSolar Feb 19 '15 at 07:37