One solution is to build the shell with HAVE_READLINE preprocessor symbol set to 1, and link with the readline library. Another solution would be to use control-left_arrow and control-right_arrow instead of the Alt qualified keys. (After all, the Mac has no Alt key, right?)