Difference between revisions of "Curses interface"

From NetHackWiki
Jump to navigation Jump to search
m
(Add missing <tt> tags and clarify that nh4 and variants use libuncursed, not curses)
 
(17 intermediate revisions by 8 users not shown)
Line 15: Line 15:
 
* Fancier display (e.g. window borders, optional popup dialogs, splash screen, and better menus)
 
* Fancier display (e.g. window borders, optional popup dialogs, splash screen, and better menus)
 
* Improved keyboard navigation of menus
 
* Improved keyboard navigation of menus
* "cursesgraphics" option for fancier line-drawing characters for drawing the dungeon - this should work on most terminals/platforms
+
* "symset:curses" option for fancier line-drawing characters for drawing the dungeon&mdash;this should work on most terminals and platforms
* Ability to have a permanent inventory sidebar by enabling `perm_invent`
+
* Ability to have a permanent inventory sidebar by enabling <tt>perm_invent</tt>
  
 
==Public servers==
 
==Public servers==
[[nethack.alt.org]] and the public servers of [[UnNetHack]] have the Curses interface installed as an alternative to the standard [[ASCII]] interface. Note, however, that nethack.alt.org has the curses interface available only in NetHack 3.4.3; NetHack 3.6 does not support it yet.
+
[[nethack.alt.org]] currently hosts [[NetHack 3.6.7]], which has the curses interface enabled as an alternative to the standard [[ASCII]] interface.
  
[[NetHack 4]] and its derivatives [[NetHack Fourk]] and [[FIQHack]] use the curses interface by default; any server which hosts these variants supports it.
+
[[Hardfought]] offers the curses interface for almost every variant hosted, save for [[NetHack 1.3d]], [[Slash'EM]], [[SlashTHEM]] and [[ZapM]].
  
==Configuration Options==
+
[[DynaHack]] uses the curses interface by default.
 +
 
 +
[[NetHack 4]] and its derivatives [[NetHack Fourk]] and [[FIQHack]] use an interface similar to curses but do not actually use curses, instead using libuncursed.
 +
 
 +
==Configuration options==
  
 
Some configuration [[option]]s that are specific to or relevant to the curses windowport are shown below.
 
Some configuration [[option]]s that are specific to or relevant to the curses windowport are shown below.
Line 31: Line 35:
 
|'''Use this to enable curses interface''', if the binary was compiled with multiple window interfaces, and curses is not the default.
 
|'''Use this to enable curses interface''', if the binary was compiled with multiple window interfaces, and curses is not the default.
 
|-
 
|-
|<tt>OPTIONS=IBMgraphics</tt>
+
|<tt>OPTIONS=symset:IBMgraphics</tt>
|Set this for Windows systems, or for PDCurses for SDL on any system. The latter uses a cp437 font, which works with this option.
+
|Set this for Windows systems, or for PDCurses for SDL on any system. The latter uses a cp437 font, which works with this option. For 3.4.3, use <tt>OPTIONS=IBMgraphics</tt>.
 
|-
 
|-
|<tt>OPTIONS=cursesgraphics</tt>
+
|<tt>OPTIONS=symset:curses</tt>
|Set this if IBMgraphics above won't work for your system. Mutually exclusive with the above option, and should work on nearly any system.
+
|Set this if IBMgraphics above won't work for your system. Mutually exclusive with the above option, and should work on nearly any system.  For 3.4.3, use <tt>OPTIONS=cursesgraphics</tt>.
 
|-
 
|-
 
|<tt>OPTIONS=align_message:bottom
 
|<tt>OPTIONS=align_message:bottom
Line 50: Line 54:
 
This is supported on PDCurses for SDL as well as PDCurses for Windows.
 
This is supported on PDCurses for SDL as well as PDCurses for Windows.
 
|-
 
|-
|<tt>OPTIONS=windowborders:3</tt>
+
|<tt>OPTIONS=windowborders:2</tt>
 
|Controls the usage of window borders for the main NetHack windows (message, map, and status windows).
 
|Controls the usage of window borders for the main NetHack windows (message, map, and status windows).
  
A value of 1 forces the borders to be drawn, a value of 2 forces them to be off, and a value of 3 allows the code to decide if they should be drawn based on the size of the terminal window.
+
A value of 0 forces the borders to be off, a value of 1 forces them to be drawn, and a value of 2 allows the code to decide if they should be drawn based on the size of the terminal window.
 
|-
 
|-
 
|<tt>OPTIONS=splash_screen</tt>
 
|<tt>OPTIONS=splash_screen</tt>
Line 68: Line 72:
 
|<tt>OPTIONS=mouse_support</tt>
 
|<tt>OPTIONS=mouse_support</tt>
 
|Use the mouse for moving around. This option defaults to false.
 
|Use the mouse for moving around. This option defaults to false.
 +
|-
 +
|<tt>OPTIONS=perm_invent</tt>
 +
|Show a permanent inventory window as a sidebar.
 
|}
 
|}
  
==Links==
+
==History==
 +
 
 +
Karl Garrison developed the curses interface as a patch for NetHack 3.4.3. Both NAO and hardfought incorporated the curses interface patch in their servers. In NetHack 3.6.2, the devteam incorporated the curses interface into the vanilla codebase.
 +
 
 +
===3.4.3 Options===
 +
 
 +
<tt>OPTIONS=classic_status</tt> is a boolean option. If FALSE, the status bar has 3 lines. If TRUE, the status display has 2 lines. The default value is TRUE.
 +
 
 +
===Historical Links===
 +
 
 +
The following links are of historical value only.
 +
 
 
*[http://nethack-curses.wikia.com/ Curses interface homepage]
 
*[http://nethack-curses.wikia.com/ Curses interface homepage]
*[http://sourceforge.net/tracker/?group_id=317683&atid=1336046 Bug tracker]
+
*[http://sourceforge.net/tracker/?group_id=317683&atid=1336046 Curses interface bug tracker]
  
{{variant-343|offset=1}}
+
{{nethack-367|offset=1}}
 
{{featured}}
 
{{featured}}
 
[[Category:User interface]]
 
[[Category:User interface]]
[[Category:Patches]]
 

Latest revision as of 15:27, 22 May 2024

Expanded-status.png

The Curses interface is an alternate text-mode interface for NetHack using high-level curses routines to control the display. The curses interface has additional features compared to the traditional tty interface, such as dynamic window resizing, dynamic configurable placement of status and message windows, and mouse support.


Features

Some features of this interface compared to the traditional tty interface include:

  • Dynamic window resizing (e.g. maximizing a terminal window)
  • Dynamic configurable placement of status and message windows, relative to the map
  • Makes better use of larger and smaller terminal windows, such as a multi-line message window if there is space
  • Optional mouse support (click to move player, etc)
  • Menu text search/selection
  • Fancier display (e.g. window borders, optional popup dialogs, splash screen, and better menus)
  • Improved keyboard navigation of menus
  • "symset:curses" option for fancier line-drawing characters for drawing the dungeon—this should work on most terminals and platforms
  • Ability to have a permanent inventory sidebar by enabling perm_invent

Public servers

nethack.alt.org currently hosts NetHack 3.6.7, which has the curses interface enabled as an alternative to the standard ASCII interface.

Hardfought offers the curses interface for almost every variant hosted, save for NetHack 1.3d, Slash'EM, SlashTHEM and ZapM.

DynaHack uses the curses interface by default.

NetHack 4 and its derivatives NetHack Fourk and FIQHack use an interface similar to curses but do not actually use curses, instead using libuncursed.

Configuration options

Some configuration options that are specific to or relevant to the curses windowport are shown below.

OPTIONS=windowtype:curses Use this to enable curses interface, if the binary was compiled with multiple window interfaces, and curses is not the default.
OPTIONS=symset:IBMgraphics Set this for Windows systems, or for PDCurses for SDL on any system. The latter uses a cp437 font, which works with this option. For 3.4.3, use OPTIONS=IBMgraphics.
OPTIONS=symset:curses Set this if IBMgraphics above won't work for your system. Mutually exclusive with the above option, and should work on nearly any system. For 3.4.3, use OPTIONS=cursesgraphics.
OPTIONS=align_message:bottom

OPTIONS=align_status:right

Optionally specify the alignment of the message and status windows relative to the map window. If not specified, the code will default to the locations used in the tty interface: message window on top, and status window on bottom. Placing either of these on the right or left really only works well for wider terminal windows.
OPTIONS=popup_dialog Use a small popup "window" for short prompts, e.g. "Really save?".

If this is not set, the message window will be used for these as is done for the tty interface.

OPTIONS=term_cols:110

OPTIONS=term_rows:32

Specify the initial window size for NetHack in units of characters.

This is supported on PDCurses for SDL as well as PDCurses for Windows.

OPTIONS=windowborders:2 Controls the usage of window borders for the main NetHack windows (message, map, and status windows).

A value of 0 forces the borders to be off, a value of 1 forces them to be drawn, and a value of 2 allows the code to decide if they should be drawn based on the size of the terminal window.

OPTIONS=splash_screen Whether or not to display a fancy ascii-graphics splash screen on startup.
OPTIONS=petattr:u This controls what text attributes are used to highlight any pets. Any combination of single letters representing each text attribute may be used. Not all attributes work on all terminals.

Attributes may be one or more of: Bold, Inverse, Underline, blinK, iTalic, Rightline, or Leftline. The default is underline.

OPTIONS=guicolor Controls whether color and attributes are used for menu headers, window borders, message text, etc. This is separate from the color option, which only controls the color of the map itself.
OPTIONS=mouse_support Use the mouse for moving around. This option defaults to false.
OPTIONS=perm_invent Show a permanent inventory window as a sidebar.

History

Karl Garrison developed the curses interface as a patch for NetHack 3.4.3. Both NAO and hardfought incorporated the curses interface patch in their servers. In NetHack 3.6.2, the devteam incorporated the curses interface into the vanilla codebase.

3.4.3 Options

OPTIONS=classic_status is a boolean option. If FALSE, the status bar has 3 lines. If TRUE, the status display has 2 lines. The default value is TRUE.

Historical Links

The following links are of historical value only.