How to output tilde (~) directly
Get rid of the &quot;US International PC&quot; layout and instead use &quot;US&quot; or &quot;ABC&quot;.  You do this in system preferences &gt; keyboard &gt; input sources.
(US International PC is a special layout adopted from Windows which is intended to make it easy to write the accents needed in common European languages.)