Files
nethack/doc
PatR a64a2f85f4 fix github pull request #197 - curses CR handling
Fixes #197
Fixes #195

Add a call to nonl() to tell curses not to convert carriage return (^M)
to newline.  Line input accepts both ^J and ^M as end of line/end of
input, but the core's command processing treats ^M as "unknown command"
(by default; someone could use the BIND option to assign some command
to that character).  The end result is that accidentally pressing the
<return> or <enter> key (or Ctrl+M key combination) won't make the hero
run towards the bottom of the screen as if the user had typed ^J.  The
curses docs also claim that it allows more optimization during screen
updating by making ^J work as plain linefeed rather than ^M^J newline.

The tty interface can achieve this (the 'do not convert ^M to ^J part',
not the 'more optimization' part) by issuing the command 'stty -icrnl'
(on Unix or sufficiently Unix-like system) prior to running nethack,
but that has no effect when using the curses interface (at least with
ncurses on OSX where I've tested it).

A better fix would be to look up the current terminal settings at
program startup and only call nonl() if -crnl was in effect so that
curses and tty would behave the same in this regard, but curses is
supposed to let us avoid those sorts of messy details....
2019-06-08 08:55:44 -07:00
..
2018-11-11 10:29:52 -05:00
2019-01-08 13:56:59 -08:00
2018-09-19 21:46:07 -05:00
2018-04-25 16:54:50 -04:00
2002-01-05 21:05:47 +00:00
2018-04-25 16:54:50 -04:00
2002-01-05 21:05:47 +00:00
2018-09-21 16:36:38 -04:00
2018-09-21 18:12:42 -07:00
2018-09-21 18:12:42 -07:00
2018-04-25 16:54:50 -04:00
2018-09-21 18:12:42 -07:00
2018-09-21 18:12:42 -07:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2018-09-21 18:12:42 -07:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2003-05-11 13:40:01 +00:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-09-21 18:12:42 -07:00
2019-05-09 17:15:14 -07:00
2018-04-25 16:54:50 -04:00
2002-01-05 21:05:47 +00:00
2018-04-25 16:54:50 -04:00
2010-05-01 23:10:22 +00:00
2018-11-11 10:29:52 -05:00
2018-11-11 10:29:52 -05:00
2018-09-19 21:46:07 -05:00
2018-09-19 21:46:07 -05:00
2018-04-25 16:54:50 -04:00
2018-09-20 18:02:48 -04:00
2018-11-16 20:51:22 -05:00