You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In silent mode, typed characters are not shown in terminal, Bash supports silent mode with '-s' flag, so read -s will not echo characters on terminal. We should have similar flag in fish's read builtin.
Reacted by Greg Warner, Stefan Maric, Pysis, Alfred S. and Kunal
On the one hand I want to say that fish scripting is mainly meant for scripting fish, I think, and what use does this have for that? On the other hand, I'm a sucker for security and think shoulder surfing is scary!
Maybe we could have it print asterisks or bullets for each typed character, mimicking GUI password inputs? Some feedback that the keys actuated and that the input got sent to the right window/terminal.
read -s is currently used to enable "shell" mode in the trunk source (not released) so either that needs to be moved or another option needs to be specified.
Turns out read uses readline and stores history (#1504).
Does stty -echo interact sanely with readline?
IMNSHO whatever mechanism there will be to read silently should also inhibit history saving [at least by default].
I think this all points to a builtin flag of read being better than "do it yourself" / stdlib function.
Activity
dag commentedon May 27, 2013
On the one hand I want to say that fish scripting is mainly meant for scripting fish, I think, and what use does this have for that? On the other hand, I'm a sucker for security and think shoulder surfing is scary!
Maybe we could have it print asterisks or bullets for each typed character, mimicking GUI password inputs? Some feedback that the keys actuated and that the input got sent to the right window/terminal.
terlar commentedon May 27, 2013
Another thing that this got me thinking about would be auto-accepting, like it takes one char and then accepts it.
Do you want to continue [Y/n],y, and that would send the command directly. Sorry for bringing that up in this issue though.jhillyerd commentedon Jun 5, 2014
@dag I'd like to be able to prompt for a password as part of setting up my proxy server environment variables.
jhillyerd commentedon Jun 5, 2014
This is my workaround, not sure how portable it is:
leeola commentedon Nov 13, 2014
@dag
I'm not sure what you mean by that. How is a silent read option, not fish scripting?
Regarding what use it has, the i think it would have the same uses as
read -sin bash. Sensitive information (passwords), etc.As a sidenote, a silent option would be great, as the alternative seems to be this verbose option:
ByScripts commentedon Nov 17, 2014
Any news on that issue? Would be great.
Thanks for the workaround though.
Edit: Just tried the workaround. Didn't work. After
stty -echoI can still see the characters.leeola commentedon Nov 25, 2014
@ridiculousfish Any comment on this? A proper silent option is really useful (needed even?)
ridiculousfish commentedon Nov 26, 2014
Seems reasonable to me.
zanchey commentedon Nov 26, 2014
read -sis currently used to enable "shell" mode in the trunk source (not released) so either that needs to be moved or another option needs to be specified.tfga commentedon Jul 3, 2015
@jhillyerd's code as a function:
Asuza commentedon Oct 29, 2015
I was writing a script this morning and was rather disappointed to discover I couldn't input via a "password" mode. Hoping this get implemented soon.
ridiculousfish commentedon Nov 5, 2015
This seems like a nice to have feature
cben commentedon Feb 12, 2016
Turns out
readuses readline and stores history (#1504).Does
stty -echointeract sanely with readline?IMNSHO whatever mechanism there will be to read silently should also inhibit history saving [at least by default].
I think this all points to a builtin flag of
readbeing better than "do it yourself" / stdlib function.krader1961 commentedon Apr 12, 2017
Closed with squashed merge commit 8213885.
Pysis868 commentedon Jun 16, 2017
woo!!
GitHub - fish-shell/fish-shell - fish 2.6.0 (released June 3, 2017):
mwmcode commentedon Feb 1, 2019
Can we update the docs please?
https://fishshell.com/docs/2.6/commands.html#read
faho commentedon Feb 1, 2019
@mustafawm: We have, you're looking at an outdated version. See https://fishshell.com/docs/current/commands.html#read.
mwmcode commentedon Feb 1, 2019
Oh! thanks @faho, I was running an older version (2.6) ...just installed the latest (3) via homebrew.
dideler commentedon Oct 17, 2019
FWIW, made a very simple package to hide the input (instead of obscuring it): fish-read-silent
And an example use case as a dependency in another package: fish-index