Environment variable

From NetHackWiki
Jump to navigation Jump to search

NetHack checks a number of environment variables. Some are useful for anyone, some are just for wizard mode. HOME, MAIL, and TERM are used by many programs, not just NetHack, so caution should be taken when editing them.

General use

  • NETHACKOPTIONS - You can define configuration options here.
  • HACKOPTIONS - The same as NETHACKOPTIONS, but used only if NETHACKOPTIONS was not defined.
  • MAIL - On window ports that support reading mail, this should point to your mail spool file.
  • MAILREADER - On window ports that support reading mail, NetHack will spawn this mailreader to read your mail.
  • ROGUEOPTS - Set the ghost name in the Rogue level. For example, setting ROGUEOPTS's value to name=Foo would name the ghost to 'Foo'
  • TERM - Terminal type.
  • HOME - Your home directory.


All of these options except NH_HEAPLOG require that the game is in wizard mode.

  • WIZKIT - As the wizkit option, start with extra items.
  • SHOPTYPE - Forces the creation of a special room on every level, even if this would violate normal room creation rules. For example, setting this to z will make a Treasure zoo on every level. (see table to right)
SHOPTYPE values and their meanings
Letter Room
z or Z Treasure zoo
m or M Graveyard
b or B Beehive
t or T or \ Throne room
s or S Barracks
a or A Anthole
c or C Cockatrice nest
l or L Leprechaun hall
_ Temple
} Swamp
g or G General store
Object symbol Shop that sells those objects
  • SPLEVTYPE - Forces NetHack to use certain layouts for the special levels that have multiple layouts. For example: bigrm-2,minetn-5 would force the 2nd bigroom variant (with the dark and light areas), and the 5th minetown variant (the grotto town).
  • NH_HEAPLOG - If the value is a file name and NetHack can write to that file, all memory allocations and release information done by NetHack is written there. This is only available if the MONITOR_HEAP compile-time option is enabled, which by default it it is not.

This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.