Check for spurious output at bash login shell#2132
Merged
sphuber merged 3 commits intoOct 28, 2018
Merged
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.
dev-zero
reviewed
Oct 26, 2018
| clear | ||
| echo "Hi! This is a new shell" | ||
| ;; | ||
| esac |
Contributor
There was a problem hiding this comment.
the guard usually looks as follows:
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
dev-zero
previously approved these changes
Oct 26, 2018
Contributor
dev-zero
left a comment
There was a problem hiding this comment.
The guard usually looks a bit different as stated in the comment, but if you want to keep it like this, it is ok.
Contributor
|
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.
Member
Author
|
Done. Happy to get an approval again if now it's ok. |
sphuber
approved these changes
Oct 28, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testthat has pointersto the documentation and the issue, making it (hopefully) clear
early on to the user on how to solve the issue.