Writing An Ncurses Game On Mac

ncurses
Developer(s)GNU Project
Initial release1993; 27 years ago
Stable release
6.2 / 12 February 2020; 54 days ago
Repository
Written inC
Operating systemPOSIX
TypeWidget toolkit
LicenseX11 License[1]
Websitewww.gnu.org/software/ncurses/ncurses.html

ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces in a terminal-independent manner. It is a toolkit for developing 'GUI-like' application software that runs under a terminal emulator. It also optimizes screen changes, in order to reduce the latency experienced when using remote shells.

Jan 15, 2002  I have been trying to write a relatively simple command line application which makes use of various ncurses functions. In the process I found that the copy of curses that came installed on OS X was lacking in many features. So I downloaded and installed (successfully) ncurses. Apr 02, 2014 If you are stuck on the console and need to pretend like you are working, Freesweep is a great game for Ncurses. You can play this console game for linux using putty or ssh as well. It is a clone of Minesweep that runs from the keyboard.

There are bindings for ncurses in a variety of programming languages, including Ada,[2]Python,[3]Gambas,[4]Ruby[5], PHP,[6]JavaScript,[7] and Perl[8].

History[edit]

As the new version, ncurses is a free-software emulation of the System V Release 4.0 (SVr4) curses, which was itself an enhancement over the discontinued 4.4 BSD curses.[9] The XSI Curses standard issued by X/Open is explicitly and closely modeled on System V.

curses[edit]

The first curses library was developed at the University of California at Berkeley, for a BSD operating system, around 1980 to support Rogue, a text-based adventure game. It originally used the termcap library, which was used in other programs, such as the vi editor.[9]

The success of the BSD curses library prompted Bell Labs to release an enhanced curses library in their System V Release 2 Unix systems. This library was more powerful and instead of using termcap, it used terminfo. However, due to AT&T policy regarding source-code distribution, this improved curses library did not have much acceptance in the BSD community.[9]

pcurses[edit]

Around 1982, Pavel Curtis started work on a freeware clone of the Bell Labs curses, named pcurses, which was maintained by various people through 1986.[10]

ncurses[edit]

The pcurses library was further improved when Zeyd Ben-Halim took over the development effort in late 1991.[9][10][11] The new library was released as ncurses in November 1993, with version 1.8.1 as the first major release. Subsequent work, through version 1.8.8 (M1995), was driven by Eric S. Raymond, who added the form and menu libraries written by Juergen Pfeifer.[12] Since 1996, it has been maintained by Thomas E. Dickey.[10]

Most ncurses calls can be easily ported to the old curses. System V curses implementations can support BSD curses programs with just a recompilation.[13] However, a few areas are problematic, such as handling terminal resizing, since no counterpart exists in the old curses.

Terminal database[edit]

Ncurses tutorial

Ncurses can use either terminfo (with extensible data) or termcap. Other implementations of curses generally use terminfo; a minority use termcap. Few (mytinfo was an older exception[14]) use both.

License[edit]

Ncurses is a part of the GNU Project. It is one of the few GNU files not distributed under the GNU GPL or LGPL; it is distributed under a permissive free software licence, similar to the MIT License.[15] This is due to the agreement made with the Free Software Foundation at the time the developers assigned their copyright.

When the agreement was made to pass on the rights to the FSF, there was a clause that stated:[15]

The Foundation promises that all distribution of the Package, or of any work 'based on the Package', that takes place under the control of the Foundation or its agents or assignees, shall be on terms that explicitly and perpetually permit anyone possessing a copy of the work to which the terms apply, and possessing accurate notice of these terms, to redistribute copies of the work to anyone on the same terms.

According to the maintainer Thomas E. Dickey, this precludes relicensing to the GPL in any version, since it would place restrictions on the programs that will be able to link to the libraries.[15]

Programs using ncurses[edit]

There are hundreds of programs which use ncurses.[16][17] Some, such as GNU Screen and w3m, use only the termcap interface and perform screen management themselves. Others, such as GNU Midnight Commander and YaST, use the curses programming interface.

See also[edit]

  • conio.h – A C header file used in MS-DOS compilers to create text user interfaces
  • SMG$ – The screen-management library available under OpenVMS

References[edit]

Writing An Ncurses Game On Mac Os

  1. ^'NCURSES — Licensing'. Retrieved July 9, 2013.
  2. ^Ada95 Binding for ncurses
  3. ^Curses Programming with Python - Python documentation
  4. ^gb.ncurses - Gambas Wiki
  5. ^ncurses Ruby - RubyGems.org
  6. ^Ncurses functions - PHP Manual
  7. ^nc plugin: ncurses bindings for SpiderApe
  8. ^Curses::UI - A curses based OO user interface framework
  9. ^ abcdEric S. Raymond (September 1995). 'ncurses: Portable Screen-Handling for Linux'. Linux Journal.
  10. ^ abcThomas E. Dickey (December 1996). 'NCURSES - New Curses'.
  11. ^The README file in ncurses 1.8.1 states 'v0.1 July 31, 1992' and 'v1.8.1 November 5, 1993', which agrees with the NEWS (changelog) file
  12. ^NCURSES - Frequently Asked Questions (FAQ): Who wrote NCURSES?
  13. ^A Hacker's Guide to Ncurses Internals
  14. ^Sydney S. Weinstein (April 1993). 'On the Networks'. C/C++ Users Journal.
  15. ^ abcNCURSES - Frequently Asked Questions (FAQ): Is it GPL'd?
  16. ^'Search results: +ncurses on freshmeat.net'. Archived from the original on February 18, 2012. Retrieved 2013-05-10.
  17. ^'Projects tagged 'ncurses''. ohloh.

External links[edit]

  • Official website
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Ncurses&oldid=943593737'

Writing An Ncurses Game On Mac And Cheese

This is a near complete rewrite of nmon (file lmon15g.c dated 2015-07-13). The original nmon would not run under OS X since Darwin (the version of BSD which underlies Mac OS X) does not provide a /proc directory; system calls needed to replace the reading of files in the /proc directory. Upon attempting to switch /proc file reads with system calls it quickly became apparent why no one else had performed the conversion; nmond is an older program, built using older development techniques, which had grow organically over the years. Simply swapping out the relevant code would have resulted in a buggy mess, so the entire program was restructured.

Since there is already a working version for Linux (and some UNIX distributions), this project does not seek to preserve compatibility with them. All of the special code required to work with those distros was be removed to make porting easier. The program was designed and tested for OS X, but the code should compile on any other BSD variant as well.

Building

Just type make in the nmond directory to build nmond. It can be installed by issuing the sudo make install command (this assumes that you have command line tools installed).

Issues

I do not spent much time updating this program anymore. Amazingly, it has continued to work even as Apple has updated some of the deep dark places in Darwin. If an issue does come up though, let me know and I will see what I can do. Just be sure to at me in the issue. I don't check the issues here much, so otherwise it could be a while before I notice that there is a new issue.

Writing An Ncurses Game On Mac Pro

A Note on Security

Writing an ncurses game on mac pro

Writing An Ncurses Game On Mac Free

In order to get complete process information, without requiring the use of sudo, this program is owned by root and has its setuid bit set. This is also beta software. As a general rule, it is not wise to allow beta software to have elevated permissions on your system. However, the program does not actively involve itself with remote connections, so this should only be a concern if untrusted users are given command access to the computer on which nmond is installed. The program will operate without the setuid bit (sudo chmod u-s /usr/local/bin/nmond), but the information it displays will be inaccurate due to lack of access; that can be mitigated by invoking it with the sudo command.

Please consider your environment before installing this application, and be sure to read and understand the license agreement.

Potential Related Problems

Ncurses C

Some systems have restrictions on the use of setuid programs. If the program does not give complete process information when run from a home directory, then the home directories disk may be mounted with the nosuid option. Mounting the home disk with nosuid is a sensible choice, the application should be installed to the /usr/local/bin directory.