-
Notifications
You must be signed in to change notification settings - Fork 192
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
Check for spurious output at bash login shell #2132
Check for spurious output at bash login shell #2132
Conversation
This fixes aiidateam#1890 and fixes aiidateam#1887. This is a different solution than PR aiidateam#1880 and superses it. We both document what the user shell should NOT do (produce output if in interactive mode), and explain how to keep this but guard it so that no output is produced at least in non-interactive mode. Moreover, we add a test in `verdi computer test` that has pointers to the documentation and the issue, making it (hopefully) clear early on to the user on how to solve the issue.
clear | ||
echo "Hi! This is a new shell" | ||
;; | ||
esac |
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.
the guard usually looks as follows:
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
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.
The guard usually looks a bit different as stated in the comment, but if you want to keep it like this, it is ok.
I would suggest to follow @dev-zero on the formatting. This is what most people expect to see. Nice to get this documented for new and possibly inexperienced users. |
As suggested by @dev-zero. Also, removing a sentence that would apply only if we were using non-login shells.
Done. Happy to get an approval again if now it's ok. |
This fixes #1890 and fixes #1887.
This is a different solution than PR #1888 and superses it.
We both document what the user shell should NOT do (produce
output if in interactive mode), and explain how to keep this
but guard it so that no output is produced at least in
non-interactive mode.
Moreover, we add a test in
verdi computer test
that has pointersto the documentation and the issue, making it (hopefully) clear
early on to the user on how to solve the issue.