InputLine history handling improved