It is possible to bind Command Key from mac os x in zsh? I can't find any information about that.
If you use iTerm2, you can. First, configure hotkeys to send your custom codes:
And then you can bind them by putting the following in your
Yes, but it's not as straightforward as you might hope.
First of all, the Mac OS doesn't pass a control sequence to applications when command-key combinations are pressed. Applications instead offer functions to the OS which can be executed via Apple Events. The binding of key combos to the specific apple event occurs at the OS level.
The best solution I can think of would be along the following lines:
Approach 1 is imperfect because you can't run it in the current window shell session. Approach 2 is imperfect because it will give undesired results when the active shell session is running anything other than zsh.