diff --git a/config/bashrc b/config/bashrc index a176a76..cc8472d 100644 --- a/config/bashrc +++ b/config/bashrc @@ -1,5 +1,9 @@ . /etc/bashrc +# === container enter logic === +ENTER_DIR="${ENTER_DIR/#\~/$HOME}" +[ -d "$ENTER_DIR" ] && cd "$ENTER_DIR" + # === environment === export EDITOR=nvim \ WAYLAND_DISPLAY=wayland-0 \ diff --git a/enter.sh b/enter.sh index 1e9160e..172ceef 100755 --- a/enter.sh +++ b/enter.sh @@ -73,4 +73,4 @@ if [ "$force" = true ] || [ "$(podman container inspect "$name" -f {{.State.Runn fi podman start "$name" 1>/dev/null -podman exec --detach-keys "ctrl-@" -it "$name" bash -l +podman exec -e ENTER_DIR="${PWD/#$HOME/\~}" --detach-keys "ctrl-@" -it "$name" bash -l