properly escape prompt spaces