sjurba / rebase-editor

Simple terminal based sequence editor for git interactive rebase.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CTRL-Down, CTRL-Up, SHIFT-Down, SHIFT-Up doesn't work on Mac

sjurba opened this issue · comments

When capturing with stdin.setRawMode(true) it doesn't return anything for those keys on Mac.

If you want to see for your self, configure rebase-editor -s to get a status bar on top that show exactly what keys are pressed..

Any help or suggestions on this issue are very welcome.

In the mean time we have to settle with using Left and Right..

I figured it out! You can configure the terminal to send the keys..

Terminal --> Preferences... --> Profiles --> Keyboard

Seletct + to add a key:
Key: Cursor Up
Modifier: Shift
Action: Send text:
\033[1;2A

Here are the relevant keys to configure:
⇧↑ \033[1;2A
⌃↑ \033[1;5A

⇧↓ \033[1;2B
⌃↓ \033[1;5B

For a complete list of available keys:
https://github.com/google/terminal-app-function-keys/blob/master/README.md

If you want to use custom keys, use the -k parameter. It is also smart to enable the status bar with -s while testing. See command line arguments.

To use HOME and END:
↖ \033[H
⇧↖ \033[1;2H

↘ \033[F
⇧↘ \033[1;2F

For PAGE_UP and PAGE_DOWN
⇞ \033[5~
⇧⇞ \033[5;2~

⇟ \033[6~
⇧⇟ \033[6;2~

For selection to work with PAGE_UP/DOWN you also need to disable Scroll alternate screen