Mac OSX 1-key brings up help

Questions and problems about using polymake go here.
vger2357

Mac OSX 1-key brings up help

Postby vger2357 » 30 Jul 2017, 17:22

I am running polymake (3.1) on a Mac OSX (10.12.6). I was just working with polymake and interactive mode, I find that whenever I hit the "1-key" it brings up the help message (i.e., if I were to write help;) and doesn't display the 1.

I've tried this with both the precompiled format dmg as well as installing it myself. This is a fairly new machine, so many settings are "out of the box". There might be an issue in one of my settings/preferences, but I couldn't find anything.

User avatar
gawrilow
Main Author
Posts: 423
Joined: 25 Dec 2010, 17:40

Re: Mac OSX 1-key brings up help

Postby gawrilow » 30 Jul 2017, 19:04

polymake (via GNU readline) interprets as a help key anything which is returned by tgetent for the 'k1' entry code (cf. man terminfo for the exhausting list of key codes). Maybe your terminal type is somewhat exotic (will say, Apple screwed it up somehow).

The first aid should be to lift the curse from your '1' key. To this end, please open your preferences file ~/.polymake/prefer.pl in a text editor, look for the line containing $help_key, uncomment it, and change the value assigned there to something which would not collide with normal alphanumeric keys, e.g. '_F2' for the function key F12. Then start polymake and verify that all normal symbol keys are working properly.

Later you might want to figure out how to map a function key of your choice to the help function (sometimes it might prove useful, e.g. when you typed in a function name and forgot the order of arguments.) Then you can edit the file prefer.pl again, or use the set_custom command from the polymake shell (albeit the effect will become perceptible only in the next session). Maybe our Mac gurus will find a proper mapping in the meanwhile, then we'll post the solution here.

blorenz
Developer
Posts: 139
Joined: 10 Jan 2011, 17:21

Re: Mac OSX 1-key brings up help

Postby blorenz » 31 Jul 2017, 15:12

I just hit the same issue on opensuse 42.2 and this might be caused by a broken termcap/terminfo database shipped with ncurses (broken in version 20170701, fixed in 20170715).

Code: Select all

$ perl -e 'use Data::Dumper; use Term::Cap; $Data::Dumper::Useqq = 1; print Dumper(Term::Cap::Tgetent->{_k1});' $VAR1 = "\eOP"; # alternatively, depending on your $TERM you might also get: $VAR1 = "\e[11~";
If this gives $VAR1 = 1; then your termcap/terminfo files are broken and you need to update ncurses (via brew, fink or manually, depending on how you installed the polymake dependencies).
I'm not quite sure how this happens for the bundle, because i dont think the terminfo files from OS X are affected by this issue.

Benjamin

PS:
Bugreports for opensuse and debian; and the ncurses changelog:
https://bugzilla.opensuse.org/show_bug.cgi?id=1049344
https://bugs.debian.org/cgi-bin/bugrepo ... bug=868266
http://invisible-island.net/ncurses/NEWS.html#t20170715


Return to “Helpdesk”