-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Persist bash history in devcontainer #4389
Changes from 3 commits
2db19a6
2eb9bdc
f527a85
3ad7782
13fa6b7
cf3c85f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||
OVERLAY_DIR=/opt/overlay_ws | ||||||
|
||||||
# https://docs.ros.org/en/rolling/Tutorials/Workspace/Creating-A-Workspace.html#source-the-overlay | ||||||
OVERLAY=$OVERLAY_DIR/install/setup.bash | ||||||
UNDERLAY=/opt/ros/${ROS_DISTRO}/setup.bash | ||||||
if [ -f "$OVERLAY" ]; then | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think we should add this kind of logic to a one off script. Let's add an alias to the .bashrc instead, as we still may need to open a shell without automatically sourcing a workspace. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm curious to know which use cases would be affected by the auto-sourcing of the workspace? Adding an alias to the bashrc doesn't add much more value to manually doing it (once it's done once and in the bash history, it's easy to pull up). |
||||||
source $OVERLAY | ||||||
else | ||||||
source $UNDERLAY | ||||||
fi | ||||||
|
||||||
# https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the vscode docs recommends to bake this into the Dockerfile, but I think that's just adds unnecessary opportunities to bust the docker layer cache when it doesn't have to. Please add such user session config to the navigation2/.devcontainer/post-create-command.sh Lines 10 to 11 in d302f1a
|
||||||
export PROMPT_COMMAND='history -a' | ||||||
export HISTFILE=/commandhistory/.nav2_bash_history |
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.
When I overhaul the user account setup for the devcontainer, we can track such dot files easier than using root level paths.