Protect against ~ in autocompletion pattern