-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat: add input_hidden function #492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a test :-)
I copied the existing test of the I found a weird issue when running the test. It prints the following messages into stderr when calling stty
However it works fine even in that case. I need some help to figure out if thats okay, or should be surpressed somehow or anything. |
Let's see what happens in the CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stty: 'standard input': Inappropriate ioctl for device
Please enter your name:stty: 'standard input': Inappropriate ioctl for device
Have you tried read -s -p "The prompt"
?
I've tested this and it works perfectly. But since input
uses read
command I think it would be nice if we used read
command for input_hidden
too.
If i run the test now
outputs just Running this
turns it interactive again and outputs Which is missing the linebreak. I'll look into this again in a bit. |
So the issue with I'm not sure if
I would like to
EDIT: maybe i've just got the wrong idea and we don't want to send a newline at all, just leave it up for the end user... |
Assuming you're planning to modify
The
Why can't you just add an artificial newline?
Seems to fix the problem:
|
Thanks :) I'm fine with that solution, as long as both input functions are handled equally. So waiting for other opinions on that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@Ph0enixKM can we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works great
Adds
input_hidden
function tostd/env
Prompts for input, but hides the user input (useful for password prompts)