M-<key> shortcuts with altmeta enabled weren't working when preceded by
a count (e.g. 2 M-j for "jump twice"): g.program_state.getting_a_command
determined whether <esc> should be read as staring a potential meta key
combination, and was being reset by readchar on the first digit entered
without being reactivated for subsequent input. As a result, by the
time the player entered the actual command to be modified by the count,
readchar wasn't bothering to look for M-<key> sequences.
if (inkey) {
key = inkey;
inkey = '\0';
- } else
+ } else {
+ g.program_state.getting_a_command = 1; /* readchar altmeta
+ * compatibility */
key = readchar();
+ }
if (digit(key)) {
cnt = 10L * cnt + (long) (key - '0');