fix spawn process function
separate terminal and shell