same as for `readline`