Skip to content

Proper MacOS Shift+option+arrows sequences #5

Description

@lokot0k

Hi! I installed your plugin and everything seemed great, but shift+option+arrows sequences weren't working for default apple terminal. I saw that this not only me and problem was mentioned before in the issue #2 So, I figured why this is the case. For some reason, terminal doesn't see option key as modificator of sequence by default. To enable such behaviour, it's needed to check "use option as meta key" checkbox in Terminal > Settings > Keyboard. After this, sequences produced with pressed option key will be modificated. But sequences will be different from these that are in config. So, it's needed to replace mac-relation bindings to:

for	kcap   seq          seq_mac    widget (             # key name
        kLFT   '^[[1;2D'    x          backward-char        # Shift + LeftArrow
	kRIT   '^[[1;2C'    x          forward-char         # Shift + RightArrow
	kri    '^[[1;2A'    x          up-line              # Shift + UpArrow
	kind   '^[[1;2B'    x          down-line            # Shift + DownArrow
	kHOM   '^[[1;2H'    x          beginning-of-line    # Shift + Home
	x      '^[[97;6u'   x          beginning-of-line    # Shift + Ctrl + A
	kEND   '^[[1;2F'    x          end-of-line          # Shift + End
	x      '^[[101;6u'  x          end-of-line          # Shift + Ctrl + E
	x      '^[[1;6D'    '^[^[[D'  backward-word        # Shift + Ctrl/Option + LeftArrow
	x      '^[[1;6C'    '^[^[[C'  forward-word         # Shift + Ctrl/Option + RightArrow
	x      '^[[1;6H'    '^[^[[H'  beginning-of-buffer  # Shift + Ctrl/Option + Home
	x      '^[[1;6F'    '^[^[[F'  end-of-buffer        # Shift + Ctrl/Option + End
);

I suggest add this information into "Known issues" article to help others since your plugin provides very helpful and useful keybindings!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions