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 mask input mode #182

Merged
merged 1 commit into from
Mar 2, 2020
Merged

add mask input mode #182

merged 1 commit into from
Mar 2, 2020

Conversation

lifubang
Copy link
Contributor

As mentioned in redis/redis#6834
I try to add mask input mode to linenoise.
Add two functions:
linenoiseMaskModeEnable
linenoiseMaskModeDisable

And in ./linenoise_example
You can use /mask to enable input masking, and use /unmask to disable it.

Signed-off-by: lifubang lifubang@acmcoder.com

Copy link

@itamarhaber itamarhaber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - didn't test however ;)

linenoise.c Outdated Show resolved Hide resolved
linenoise.c Outdated Show resolved Hide resolved
linenoise.c Outdated Show resolved Hide resolved
Signed-off-by: lifubang <lifubang@acmcoder.com>
@lifubang
Copy link
Contributor Author

lifubang commented Mar 1, 2020

Looks good to me - didn't test however ;)

Thanks for your review.
You can use example.c to test.

lifubang@DESKTOP-3DDGGHK:/mnt/e/Develop/cc/linenoise$ ./linenoise_example 
hello> get mykey
echo: 'get mykey'
hello> /mask
hello> *********
echo: 'get mykey'
hello> *****
echo: 'hello'
hello> *******  # this is /unmask
hello> get mykey
echo: 'get mykey'
hello>

@antirez antirez merged commit f31e883 into antirez:master Mar 2, 2020
@antirez
Copy link
Owner

antirez commented Mar 2, 2020

Merged and improved a bit in 4261898. Thank you.

@lifubang
Copy link
Contributor Author

lifubang commented Mar 3, 2020

Thanks for your improved.
There is still a small bug, I have sent s fix PR, PTAL.

sn1kketysnake pushed a commit to sn1kketysnake/linenoise that referenced this pull request Oct 14, 2020
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.

3 participants