Use readline if running in the background, to avoid terminal access signals