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

Add delete home end support #12

Merged
merged 5 commits into from
Oct 28, 2015
Merged

Add delete home end support #12

merged 5 commits into from
Oct 28, 2015

Conversation

michalpristas
Copy link
Contributor

Added support for Delete key and Home/End keys
Tested on Ubuntu

Delete key is weird as it is specified by set of 4 runes (instead of 3 as with Home, End, or Ctrl + Anything combo). The seqence is 27 91 51 126

So workaround was made (in terminal.go) for this case, it checks whether Delete command was used (Ctrl + D or Delete key both returns CharDelete) and if so then it checks if next rune in buf is 126 if not it will put it back on top of the stack.

@chzyer
Copy link
Owner

chzyer commented Oct 23, 2015

@michalpristas Thanks for catching that.
I think we can change the function escapeExKey(rune) rune to escapeExKey (bufio.Reader) rune, so that it can deal with multiple runes such as <Esc>[3~ and call ReadRune / UnreadRune within escapeExKey.
What do you think?

@michalpristas
Copy link
Contributor Author

i think it is a great point. i will get back to it tomorrow morning

@michalpristas
Copy link
Contributor Author

I moved check as proposed, in order to do that had to pass the reader down to the method.

chzyer added a commit that referenced this pull request Oct 28, 2015
@chzyer chzyer merged commit ffee92f into chzyer:master Oct 28, 2015
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

Successfully merging this pull request may close these issues.

2 participants