Wikia

Wikihack

Watchlist Recent changes

Shell escape

In game, the ! key triggers the shell escape. This should send you to a command line; exit the shell to return to NetHack. The exact behavior varies by operating system.

It only works if the person who compiled the game had SHELL defined in config.h. Persons who build the game for public servers or other environments in which the player should not reach a shell will disable it.

In the source code, the dosh function handles this. The code for this function, if any, is somewhere under the nethack-3.4.3/sys directory for your operating system.

The file nethack-3.4.3/sys/unix/unixunix.c contains the source for shell-escaping for a Unix system. If there is a SHELL environment variable, then NetHack will start that program, else NetHack will attempt to run /bin/sh. In most shells, the exit command will then return you to NetHack. Since most Unix now have job control, you could just press Ctrl +  Z to suspend NetHack and return to the calling shell instead of starting a subshell; for that reason some players may never think to use the shell escape.

Pages on Wikihack

Add a Page
2,022pages on
this wiki

Latest Photos

Add a Photo
1,116photos on this wiki
See more >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki