-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Let read builtin take a custom prompt string #802
Comments
I think it can be closed as it already implemented. |
@rominf: Huh? Aware of any feature to do so, other than |
Sorry, I misread issue. 😞 Yes, you are right. I wish that feature too. |
It actually takes arbitrary fishscript, so you can use function dangerous_function
echo 'I will do dangerous stuff'
read -l -p 'echo "Do you want to continue? [Y/n] "' continue
if test $continue = 'Y' -o $continue = 'y'
echo 'Do dangerous stuff'
end
end Although I do agree that taking a prompt string is easier and more common. |
[crossposting from #2166 where it didn't really belong] |
Actually the standard gradual-deprecation strategy is possible here too:
I'm willing to do the work if you think the gain is worth it. |
Please see #2166 (comment) for a solution implemented in userland. |
The current Outside of the We can't break backward compatibility without at least one major release. We can, however, add a saner |
I want to reinforce that the current
Nonetheless, that flexibility is overkill most of the time and simply confuses the script writer trying to prompt someone for input. So it makes sense to provide a simpler UI that satisfies 98% of the |
woo!! GitHub - fish-shell/fish-shell - fish 2.6.0 (released June 3, 2017):
|
Right now it only takes a function name which is a little bit cumbersome if you want to use a custom prompt for a specific use case. The worst part is you have to come up with some name for your prompt and you litter your functions.
Current use case:
If we let
-p
take a string instead people could use a function if they want by using parenthesis,-p (continue_prompt)
.The text was updated successfully, but these errors were encountered: