Repository navigation
Conversation
`eval "$(termdock shell-init)"` in a startup file printed # Add to your bash startup file: # eval "$(termdock shell-init bash)" on every shell you opened. The note was on stderr, which the comment above it claimed was enough to keep it out of the way. It is not: command substitution captures stdout and leaves stderr pointed straight at the terminal, so the one place the note was guaranteed to appear was the one place it must not. Whether stdout is a terminal is what actually separates the two cases, so that is the condition now. Run by hand it still explains itself; run under eval, or redirected to a file, it says nothing. The snippet itself was always fine and went to stdout as it should, so the integration was working the whole time, just noisily. Not fixed by deleting the note: it earns its place when someone runs the command to see what it does, and a commented-out printf would have left dead code in place of a condition. While extracting the name resolution to test it, the docs got the missing half of the $SHELL caveat. They said it detects from $SHELL and that you may name a shell explicitly, without saying when you would want to: $SHELL is the login shell, so anyone who logs in with zsh and also uses bash was being told to put a line in ~/.bashrc that would emit zsh.
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.
eval "$(termdock shell-init)"in a startup file printedAdd to your bash startup file:
eval "$(termdock shell-init bash)"
on every shell you opened. The note was on stderr, which the comment above it claimed was enough to keep it out of the way. It is not: command substitution captures stdout and leaves stderr pointed straight at the terminal, so the one place the note was guaranteed to appear was the one place it must not.
Whether stdout is a terminal is what actually separates the two cases, so that is the condition now. Run by hand it still explains itself; run under eval, or redirected to a file, it says nothing. The snippet itself was always fine and went to stdout as it should, so the integration was working the whole time, just noisily.
Not fixed by deleting the note: it earns its place when someone runs the command to see what it does, and a commented-out printf would have left dead code in place of a condition.
While extracting the name resolution to test it, the docs got the missing half of the $SHELL caveat. They said it detects from $SHELL and that you may name a shell explicitly, without saying when you would want to: $SHELL is the login shell, so anyone who logs in with zsh and also uses bash was being told to put a line in ~/.bashrc that would emit zsh.