Minimal replacement for readline