readline wrapper