Dear Thomas,
I'm using ncurses via python on OS X. There seems to be an issue with the OS X terminal.
When using the X11 emulator (XQuartz) the alt key on the keyboard is ignored, but the command key acts as meta. The keys are reported as one would expect, so that Meta-K is reported by the keyname(ch) and unctrl(ch) functions as "M-k" and "!k".
However, in Terminal.app (where alt appears to operate as Meta) Meta-K is reported as "M-^Z", or, if the preference "use option key as meta" is set, simply as "k".
Are these known problems with Terminal.app and curses?
Best wishes,
Nicholas