Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Alt key seems to be ignored. #821

Closed
alok opened this issue Oct 11, 2016 · 13 comments
Closed

Alt key seems to be ignored. #821

alok opened this issue Oct 11, 2016 · 13 comments

Comments

@alok
Copy link

alok commented Oct 11, 2016

I type <A-d> in vim and instead of executing a mapping, it gives the key sequence <2202> and does nothing.

@drew-gross
Copy link
Contributor

I'm not a VIM user. What is the expected behaviour?

@alok
Copy link
Author

alok commented Oct 14, 2016

It should executed whatever mapping I assigned to it. In this case,
deleting a line.
On Thu, Oct 13, 2016 at 7:46 PM Drew notifications@github.com wrote:

I'm not a VIM user. What is the expected behaviour?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#821 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH8KTLpW5fy3zd1OMpjuVDSPSpcfUBgIks5qzuz-gaJpZM4KUOon
.

  • Alok

@drew-gross
Copy link
Contributor

Sorry, I was hoping for some easy steps to follow to help me reproduce the issue. Basically, I want some instructions that I can follow in both black-screen and iTerm the exhibit different behaviour (assuming no existing vim configuration).

@alok
Copy link
Author

alok commented Oct 16, 2016

To reproduce:

create a vimrc and add this line:

nnoremap <M-d> dd

Create a nonempty file. In iterm and black-screen, press and it should recognize the keystroke in iterm and delete the line (which is what dd does). In black-screen, it should do nothing.

@drew-gross
Copy link
Contributor

Hmmm for me iTerm alt+d also does nothing when I use that vimrc. It's very confusing actually, I try various combinations of different keys and commands and they do totally unpredictable things.

@alok
Copy link
Author

alok commented Oct 24, 2016

I suspect your iTerm alt key is not set to meta or esc+.

Go to Preferences > Profiles in iTerm. select your profile and go to the keys tab. the option is on the bottom right.

Most people seem to use esc+ according to iTerm's FAQ.

@vlad-shatskyi
Copy link
Contributor

To fix it in Job.write we can check whether alt is pressed, and if it is, convert the sequence to ESC + whatever key.

https://www.w3.org/TR/uievents/#dom-keyboardevent-altkey

@drew-gross
Copy link
Contributor

@alok can you tell me what shows up in both black-screen and your usual terminal if you execute sleep 10 and then press alt+d? Having vim stuff involved is making is difficult to figure out what the correct behaviour is, and I'm not super familiar with the terminal emulation side of this project (I've mostly worked on plugins and UI stuff).

@alok
Copy link
Author

alok commented Oct 30, 2016

iterm: (nothing)
black-screen:

@drew-gross
Copy link
Contributor

@alok How about if you press it a few times in iTerm? Do you see a bunch of � symbols? Also, #852 may fix your issue but I'm not very familiar with that part of the code. If you could pull that branch and try it out to see if it fixes your issue, I would very much appreciate that.

@alok
Copy link
Author

alok commented Oct 31, 2016

Pressing it any number of times put no input on the screen. I'll try
pulling that and see if it helps.

-- Alok

On Sun, Oct 30, 2016 at 9:41 PM, Drew notifications@github.com wrote:

@alok https://github.com/Alok How about if you press it a few times in
iTerm? Do you see a bunch of � symbols? Also, #852
#852 may fix your issue
but I'm not very familiar with that part of the code. If you could pull
that branch and try it out to see if it fixes your issue, I would very much
appreciate that.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#821 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH8KTOvKC09EP13EbeB3P5u8vJv7K_Voks5q5XFdgaJpZM4KUOon
.

@alok
Copy link
Author

alok commented Oct 31, 2016

So I tried #852 and it fixed it, though typing <a-d> in the command line (outside of vim) still puts the . On the other hand, it works, so good job.

Also, I don't think you should call the pull request "fix alt-d" as it's an issue with the alt key and probably has nothing to do with that letter in particular.

@drew-gross
Copy link
Contributor

Thanks a lot for verifying. The fix only applies when you are sending keystrokes to a running program, not when you are typing into the command line. I think that's probably appropriate, what would alt+* do when typing into the command line anyway? We probably want to leave the up to the OS.

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

No branches or pull requests

3 participants