add basic emacsian shortcuts for console line editing
correctly set commandpos = -1 when an edit leaves cursor at end of input
remove debug print