better readline detection