Tilde not recognized in Mac terminal

落花浮王杯 提交于 2019-12-02 21:51:00
Rômulo Jales

Try this one:

˜ + <spacebar> 

It's results the tilde you want: ~

The ˜ character's code is 0x02DC and the code that works in bash like shortcut to home directory is 0x07E.

Venkat Ganesh

After changing the keyboard (System Preferences>Keyboard>Input Sources) from 'US International - PC' to 'U.S.', I was able to verify tilde sign (~) works as expected from Terminal.

It looks like in some of the macbook, the keyboard is set to 'US International - PC' instead of 'U.S.'

There are several characters like a tilde, and yours ˜ is not the one for the homedir ~ (close together: ˜ vs ~).

The other answers are correct in that you are not typing the regular tilde character but are using the small tilde character. What the other answers do not explain though is why when you type tilde you are getting the small tilde and not the large tilde.

The same problem plagued me for some time. I found the problem was I was using the 'US - International' key mapping. Try changing it in System preferences > Language and Text > Input Sources. With that keyboard selected you need to type the tilde and then hit the space bar to see it change from small tilde to regular tilde.

Yep, that's an enye (option-n) not ~ (shift-`)

Frederick Solt

I've run into a related issue a couple of time that may have prompted the question: bash doesn't do tilde expansion on quoted filepaths (which you might use if you have spaces in the path). For example, cd "~/Documents/My Project" gets you the same error originally posted. The trick is to leave the tilde and the first slash outside the quote: cd ~/"Documents/My Project" works just fine.

I set up KeyRemap4MacBook application and type ~ with shift+escape

alt+5 is what you are looking for...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!