sort of working. strange readline side-effects need fixing.