-
Notifications
You must be signed in to change notification settings - Fork 42
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
Use new CAP() macro for arrow keys #206
Conversation
Great work! Regarding the build failure on macOS: turns out |
Thanks again @mptre ! |
With this diff applied I can't use the arrow keys on neither OpenBSD nor Is anyone else seeing this? /cc @calleerlandsson @teoljungberg |
My arrow keys broke aswell. Tested on macOS, in Terminal.app, in tmux and outside. |
Same here in bash in Terminal.app on macOS. Backspace also doesn't work. Do we need to anything other than calling |
Yes, we do: |
Tested with/without |
pick.c
Outdated
@@ -649,6 +649,7 @@ tty_init(void) | |||
err(1, "fopen"); | |||
|
|||
setupterm((char *)0, fileno(tty_out), (int *)0); | |||
tty_putp(keypad_xmit, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find! I would prefer grouping the tty_putp
calls and make sure to
exit from the same mode.
diff --git a/pick.c b/pick.c
index 2c23aeb..df185b9 100644
--- a/pick.c
+++ b/pick.c
@@ -655,6 +655,8 @@ tty_init(void)
if (use_alternate_screen)
tty_putp(enter_ca_mode, 0);
+ tty_putp(keypad_xmit, 0);
+
signal(SIGINT, handle_sigint);
}
@@ -677,6 +679,7 @@ tty_restore(void)
tcsetattr(fileno(tty_in), TCSANOW, &original_attributes);
fclose(tty_in);
+ tty_putp(keypad_local, 0);
tty_putp(carriage_return, 1); /* move cursor to first column */
tty_putp(clr_eos, 1);
Everything works except backspace on macOS, I think we should keep the KEY(BACKSPACE, "\177"); I appreciate the effort on adding tests for the Emacs bindings, could |
What the hell is wrong with macOS? ;-) |
Check out the cap branch, it includes some cleanups and is what I |
Tested and looks good! |
Great! Lets wait for another confirmation, I will then go ahead and merge this. |
Hey @mptre and @DBOTW, I'm sorry I've been unresponsive; I've been out traveling the last week. The cap branch works well on my machine and looks great to merge! Thanks for your hard work! |
Thanks, merged! |
No description provided.