stig icon indicating copy to clipboard operation
stig copied to clipboard

Throw error message when binding invalid keys like <shift-enter>

Open doronbehar opened this issue 6 years ago • 2 comments

I want to change the default binding of alt-enter showing the files of a torrent to shift-enter but I can't get it to work. I put the following in my rc file

unbind 'alt-enter'
bind shift-enter tab lsf

I'm not sure whether I should use apostrophes or not (like that: 'shift-enter'), anyway none of the options worked.

doronbehar avatar Dec 27 '17 14:12 doronbehar

Pretty sure that's just not a possible keybinding in terminals. Pressing enter while holding shift simply sends the same key to the process running in the terminal as pressing only enter.

When I run C-h k (describe-key) in emacs and press shift-enter, it tells me what RET (enter) does, so I don't think there is a way around that limitation.

It would be nice if the key parser would tell you that shift-enter isn't a valid key combination, but there are quite a few of them (e.g. ctrl-m is indistinguishable from enter), and I don't have a list of those and don't know how/where to get one.

rndusr avatar Dec 27 '17 14:12 rndusr

I made some searches over the internet my self and you were right, it is not detectable on most terminals and not only that, it doesn't seem like there is a library that can tell you this in advanced on a per terminal basis. This is so far the best answer related to this matter:

https://stackoverflow.com/a/598404

I think it should be documented as a warning with some explanations as well.

doronbehar avatar Dec 28 '17 06:12 doronbehar