<p>I'm trying to have the same KDE Konsole experience within Mac OS X.</p>

<p>Here's my (overly complicated?) setup:</p>

<ul>
<li>I have Control and Command swapped at the System Preferences level.  (Can't live without this)</li>
<li>Parallels lets you, at the Parallels application level, also reverse Control and Command.  So I can undo the System Preferences setting (and get the setup I want within virtual Linux)</li>
</ul>

<p>I want this same per-application-opt-out for the Mac OS X Terminal app.  Is it possible?</p>

[{'answer_id': 194426, 'author': 'haa', 'author_id': 12115, 'author_profile': 'https://Stackoverflow.com/users/12115', 'pm_score': 2, 'selected': False, 'text': '<p>You can <strong>simply ssh into the Linux/Unix system</strong> and run X11 programs direct to your Mac screen: <code>ssh -X user@host_or_ipaddress</code>, login, and just run the X11 programs you want (e.g. <code>emacs&amp;</code>) and the X11 apps will appear on the Mac display.</p>\n\n<p>Pros:</p>\n\n<ul>\n<li>X11 windows work just like any other window, including Exposé goodness, etc...</li>\n<li>No need to work only inside the Parallels console window</li>\n<li>Same solution works with any Linux/Unix system, remote or virtual</li>\n<li>ssh connection is secure even over the internet</li>\n</ul>\n\n<p>Tech info:</p>\n\n<ul>\n<li>"ssh -X" turns on X11 forwarding for the ssh connection, i.e. the X11 display connection is tunneled through ssh securely</li>\n<li>"ssh -X" also handles X11 authentication tunneling</li>\n<li><code>X11.app</code> is automagically started on OSX by <code>launchd</code> when needed</li>\n<li>X11 can connect to displays over the network, which is one of the few cool things about it ;-)</li>\n</ul>\n'}, {'answer_id': 977228, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>You can customize the command keys used for an individual application in System Preferences > Keyboard &amp; Mouse > Keyboard Shortcuts.  I think (if I understand correctly what you\'re trying to do) that this might allow you to accomplish your goal.  You could remap all of Terminal\'s command keys to use control instead of command, to get them out of your way... but then you might need to do a lot of customization on the machines you ssh into, so that they use Command instead of control</p>\n\n<p>It seems that you\'re going to have to do an ENORMOUS amount of work just to allow you to use your pinky instead of your thumb for the modifier key.  </p>\n\n<p>Another possibility:  user preferences can be manipulated by the "defaults" command.  I haven\'t been able to find a way to use this to control they modifier key mappings, but it should logically be possible (if you\'re willing to do a lot of digging).  If so, then you could write short scripts to switch back and forth between Mac default and your swapped mode.  Trigger the scripts with Quicksilver, and whenever you use Terminal you can call one script, and whenever you leave it you can call another.   Again, a big pain to achieve what you want, but it <em>might</em> be possible.</p>\n\n<p>I don\'t think there\'s a clean and simple solution.  </p>\n\n<p>I\'ve seen third-party programs that give more control over manipulating modifier keys, if you\'re willing to install them (probably kernel extensions).  They <em>might</em> be able to do what you want, but I don\'t recall the names.  If you google for programs to fix emacs and vi keys you might find them.</p>\n\n<p>Good luck.</p>\n'}, {'answer_id': 4619639, 'author': 'Mario F', 'author_id': 3785, 'author_profile': 'https://Stackoverflow.com/users/3785', 'pm_score': 0, 'selected': False, 'text': '<p>I had exactly the same problem as you. I\'ve remapped Command to CAPS Lock, and Control to Command, but as a frequent Linux user I want both setups to be as similar as possible. This is how I solved it:</p>\n\n<ul>\n<li>Install <a href="http://www.keyboardmaestro.com/main/" rel="nofollow">Keyboard Maestro</a> (not free, but totally worth it), and set it up to run at login.</li>\n<li>Inside KM, define macros to send <em>CMD+{key}</em> to <em>CTRL+{key}</em> inside <strong>Terminal</strong>.</li>\n</ul>\n\n<p>If you want to remap a lot of keys this is <strong>a lot</strong> of work. But I\'ve already done it myself, you can just download this file <a href="http://dl.dropbox.com/u/3093385/terminal.kmmacros" rel="nofollow">kmmacros</a>. Double-clicking is enough to install it. A couple of caveats:</p>\n\n<ul>\n<li>You need to set <strong>Terminal</strong> to use option as a meta key (Terminal > Preferences > Keyboard).</li>\n<li>The bindings are only for emacs-mode. <a href="http://www.scribd.com/doc/985254/Bash-Emacs-Editing-Mode-readline-Cheat-Sheet" rel="nofollow">This</a> cheat sheet should be helpful.</li>\n<li>Most default shortcuts don\'t work anymore (<em>CMD-N</em>, <em>CMD-C</em>, ...), and the menu in <strong>Terminal</strong> does not reflect this. For some conflicts (New Window, Close Window), I\'ve taken the ones from Gnome.</li>\n</ul>\n'}, {'answer_id': 8332329, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 4, 'selected': False, 'text': '<p>The solution you\'re looking for is <strong><a href="http://pqrs.org/macosx/keyremap4macbook/index.html">KeyRemap4MacBook</a></strong>.  There is a Tiger, Leopard, Snow Leopard, and Lion version.</p>\n\n<p>Once installed, goto <strong>System Preferences</strong> -> <strong>KeyRemap4MacBook</strong></p>\n\n<p>Then select the following options:</p>\n\n<ul>\n<li>Change Command_L Key (Left Command)</li>\n<li>---> Command_L to Control_L (except Terminal, Virtual Machine, RDC)</li>\n<li>Change Control_L Key (Left Control)</li>\n<li>---> Control_L to Command_L (except Terminal, Virtual Machine, RDC)</li>\n</ul>\n\n<p>You can repeat this for Command_R (Right Command) and Control_R (Right Control) also if you desire.  Tested and working on my Macbook.</p>\n'}, {'answer_id': 15505757, 'author': 'vikor', 'author_id': 1430433, 'author_profile': 'https://Stackoverflow.com/users/1430433', 'pm_score': 2, 'selected': False, 'text': '<p>There is very good and key-mapping flexible terminal:  <a href="http://www.iterm2.com" rel="nofollow">iTerm2</a></p>\n\n<p>My favorite set: iTerm + zsh +  <a href="https://github.com/robbyrussell/oh-my-zsh" rel="nofollow">oh-my-zsh</a></p>\n'}, {'answer_id': 34832557, 'author': 'dorserg', 'author_id': 376893, 'author_profile': 'https://Stackoverflow.com/users/376893', 'pm_score': 2, 'selected': False, 'text': '<p>The 2016 solution is to use <a href="https://github.com/tekezo/Karabiner" rel="nofollow noreferrer">Karabiner</a> open-source program which allows you to remap modifier and other keys with <strong>very fine granularity</strong>, for example</p>\n\n<ul>\n<li>Remap only the <strong>left</strong> <kbd>⌘ Cmd</kbd> or <kbd>Option</kbd> key.</li>\n<li>Remap a key only for specific applications, e.g. only inside Terminal, Emacs, or virtual machine.</li>\n</ul>\n\n<p>For example, here\'s how to remap left <kbd>⌘ Cmd</kbd> key to act as <kbd>Ctrl</kbd> <strong>only inside Terminal</strong> (and leave the right one unaffected so that you could still use e.g. <kbd>⌘ Cmd + Tab</kbd> to switch between apps):</p>\n\n<p><a href="https://i.stack.imgur.com/GnqQ7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GnqQ7.png" alt="karabiner-screenshot"></a></p>\n'}]
['https://Stackoverflow.com/questions/75533', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8913/']