Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sjurba opened this issue Mar 24, 2017 · 2 comments
Closed

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

sjurba opened this issue Mar 24, 2017 · 2 comments

Comments

@sjurba
Copy link
Owner

sjurba commented Mar 24, 2017

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..

@sjurba
Copy link
Owner Author

sjurba commented Mar 26, 2017

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.

@sjurba
Copy link
Owner Author

sjurba commented Apr 21, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant