improve the CLI readline handling