Add +ESC key binding #120

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@yudai

Mainly for emacs users, I'd like to introduce a new form to define key bindings with a Meta key with "^[".

Exapmle:

bind generic ^[v move-page-up

In actuality, when press a key with a Meta(or Option key on Mac) key, terminal apps send a key sequence whose first key code is KEY_ESC. This commit add a trap to receive KEY_ESC and then get the main key code again.

@yudai yudai Add +ESC key binding
Exapmle:
bind generic ^[v move-page-up
5d877f0
@yudai

Hi Jonas! Thank you very much for giving me such a great tool.

I think key bindings with a Meta (or Option, Alt) are very useful for many users.
Since LESS command also allows users to page up with ^[v, I'd like to work with tig in the same way.

I'm not sure that adding 128 to the key code is the best way to represent pressing a Meta key. Some documents say Emacs uses the first bit of a 8bit key code in this way, so I choose this way.

@yudai yudai closed this Mar 24, 2013
@jonas
Owner

Hello, any reason why you are closing this pull request?

@yudai

Hi jonas! Thank you for the comment.
I thought this pull request would not be merged because I had gotten no response for a couple of weeks.
So I closed this PR just to clean up my PR list.

@jonas
Owner

Sorry on my part, I am not always quick to merge.
I will look into getting it in today.

@yudai

No problem jonas, your application really helps me everyday 👍

This change might introduce a problem to users who assign single ESC to any function, so please examine it carefully.

@jonas
Owner

OK, pushed. Thanks again for your patience. ;)

@yudai

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment