use readline with spawn