Skip to content
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

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
"source": "overlay-${devcontainerId}",
"target": "/opt/overlay_ws",
"type": "volume"
},
{
"source": "nav2-bashhistory",
"target": "/commandhistory",
Copy link
Member

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.

"type": "volume"
}
],
"features": {
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ FROM caddy:builder AS caddyer
RUN xcaddy build \
--with github.com/caddyserver/replace-response

COPY nav2_bashrc /root/nav2_bashrc
RUN echo "source /root/nav2_bashrc" >> /root/.bashrc

# multi-stage for visualizing
FROM dever AS visualizer

Expand Down
14 changes: 14 additions & 0 deletions nav2_bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
OVERLAY_DIR=/opt/overlay_ws
Copy link
Member

Choose a reason for hiding this comment

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

This should be in /tools not in the root of the repository please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah nice, I was looking for a better place

Copy link
Member

Choose a reason for hiding this comment

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

/tools is our catch-all for random developer tools


# 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
source $OVERLAY
else
source $UNDERLAY
fi

# https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history
export PROMPT_COMMAND='history -a'
export HISTFILE=/commandhistory/.nav2_bash_history
Loading