I have the following script-snipped, which I use regularly to semi-automate one of my workflows. I open a bash terminal and start irb and then paste the script:
require 'highline/import'
# ...
user = ask("User:")
repo = ask("Repository:")
# ...
# Do advanced fancy stuff
Now I want to be able to paste this into the terminal, but the first prompt for the user is overwritten by the following line: repo = ask("Repository:")
.
Is there a way to prevent this behaviour.
I know that I could write a script. But
Is there a way to prevent this behaviour.
You can prevent the echoing of pasted text with the command
stty -echo
- whether you like that is another question, since this inevitably also prevents the echoing of typed-in commands, but you can see again after entering
stty echo
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.