Skip to content

feat: add sourcing of rc files to shell snapshot#9150

Merged
jif-oai merged 4 commits intomainfrom
jif/sourcing-rc-file
Jan 14, 2026
Merged

feat: add sourcing of rc files to shell snapshot#9150
jif-oai merged 4 commits intomainfrom
jif/sourcing-rc-file

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Jan 13, 2026

No description provided.

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Jan 13, 2026

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77027eccae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core/src/shell_snapshot.rs Outdated
@pakrym-oai
Copy link
Copy Markdown
Collaborator

No tests so sad.

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Jan 13, 2026

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0791eace4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +165 to +167
r##"if [ -z "$BASH_ENV" ] && [ -r "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid double-sourcing .bashrc in login snapshot

Because the snapshot is executed via bash -lc, bash already reads the login profile (~/.bash_profile/~/.profile) before running the command. On most systems those files source ~/.bashrc, so the new unconditional . "$HOME/.bashrc" runs the rc file a second time. That can duplicate PATH entries and other side effects, producing a snapshot that does not match the real login environment for those users. Consider adding a sentinel (or detecting prior rc loading) to avoid re-sourcing when the login profile already did it.

Useful? React with 👍 / 👎.

@jif-oai jif-oai merged commit 258fc4b into main Jan 14, 2026
41 of 44 checks passed
@jif-oai jif-oai deleted the jif/sourcing-rc-file branch January 14, 2026 08:58
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants