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

Allow Ctrl-J to validate the password #71

Closed
bew opened this issue Apr 27, 2016 · 9 comments · Fixed by #72
Closed

Allow Ctrl-J to validate the password #71

bew opened this issue Apr 27, 2016 · 9 comments · Fixed by #72

Comments

@bew
Copy link

bew commented Apr 27, 2016

Hello guys,

First of all, thanks for this simple but perfect locker !


As a vim user, I like not to move my hands, for exemple to access the Enter key.. I usually use Ctrl-J to validate something, and would like to have that feature in i3lock also.

So for exemple, I type my password as usual, then I type Ctrl-J to validate the password

I went through the code, and think that there is something to change arround thoses lines :
https://github.com/i3/i3lock/blob/master/i3lock.c#L369

What do you think about this ?

@Airblader
Copy link
Member

I usually use Ctrl-J to validate something, and would like to have that feature in i3lock also.

I think this captures the problem perfectly: everybody would want something else. However, we don't want a generic binding configurability in i3lock because it would make it a whole lot more complex and therefore potentially unsafe.

IMHO you'd be best served by implementing this as a local patch.

@acrisci
Copy link
Member

acrisci commented Apr 27, 2016

I don't use i3lock, but I could see why the user base would consider this feature valuable by giving i3lock a "terminal" feel. Ctrl-j will enter a password that you enter from a terminal, for instance.

As for this being a gateway to bindings in i3lock, I don't think that would be the case. However, it would be a gateway to supporting any of the emacs-based terminal commands (such as ctrl-h for backspace, ctrl-u for kill line) which might be complicated and is definitely would be an increase of scope for i3lock. I'm not sure if there is a library that already handles that kind of user input but there might be.

I don't feel strongly either way about this, however. i3lock would be very easy to fork and make your own project out of with more scope.

@bew
Copy link
Author

bew commented Apr 27, 2016

everybody would want something else
Yes maybe, but here, C-j is not really a user-special-case..
In almost every terminal program, C-j is handled as Enter

As we don't need readline abilities (like moving the cursor, etc) but only key inputs then Enter, I don't think that multiple ways to type "Enter" is too much.

I'm I clear enough?

@acrisci
Copy link
Member

acrisci commented Apr 27, 2016

Now that I think about it, I can't imagine this exploding into either bindings or readline. If you make ctrl-j work however, people will expect ctrl-h for backspace as well.

Maybe @Airblader is not aware that this is a widely used standard in interactive unix programs and text editors (maybe from before there was an enter key or something? I don't know.).

@He-Ro
Copy link

He-Ro commented Apr 28, 2016

Chiming in here. I think that, ctrl-u would also be expected to work, if crtl-j is supported. ctrl-u deletes the whole line before the cursor. Thus I think it should delete the whole passphrase that was entered until that point, because the cursor is always at the end.

@Airblader
Copy link
Member

Airblader commented Apr 28, 2016

So Ctrl+J now already went to Ctrl+J, Ctrl+U, Ctrl+H in less than 24 hours. See my point?

@karulont
Copy link
Contributor

Ctrl+U is already in the code. I know that every feature adds unwanted complexity to i3lock. But I think in this case a few lines to add support for the Ctrl+J and Ctrl+H are not that complex. To me adding them now seems like a "bug" fix, because the three keys form a whole, and Ctrl+U is alone at the moment. One option would be to remove Ctrl+U, however that would break someones workflow. So I propose that these minor features should be added.

@stapelberg
Copy link
Member

Given that we already support the keypad return key as an alternative to return, I think adding ctrl+j would be okay — it should be just another case statement.

karulont pushed a commit to karulont/i3lock that referenced this issue Apr 28, 2016
karulont pushed a commit to karulont/i3lock that referenced this issue Apr 28, 2016
karulont pushed a commit to karulont/i3lock that referenced this issue Apr 28, 2016
@bew
Copy link
Author

bew commented Apr 30, 2016

You did it, thanks all!

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

Successfully merging a pull request may close this issue.

6 participants