better c++ support, handle empty input/prompt