From 44b550699f2e306b0b45bb592f9d0b0d1e52677c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:00:26 +0000 Subject: [PATCH 1/3] Initial plan From 39164c9d67d8a8c21528a02e2c8dbf2b6bf7bee5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:02:53 +0000 Subject: [PATCH 2/3] Add shorter terminal prompt setting for Codespaces - Add postStartCommand to devcontainer.json that sets PS1='\W\$ ' - Command is idempotent: only adds to ~/.bashrc if not already present - Add .devcontainer/README.md explaining the change and how to override Co-authored-by: lwasser <7649194+lwasser@users.noreply.github.com> --- .devcontainer/README.md | 21 +++++++++++++++++++++ .devcontainer/devcontainer.json | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/README.md diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000..42d62c7 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,21 @@ +# Dev Container Configuration + +This directory contains the configuration for GitHub Codespaces and VS Code Dev Containers. + +## Shorter Terminal Prompt + +The `postStartCommand` in `devcontainer.json` configures a shorter bash prompt (`\W\$ `) that shows only the current directory name instead of the full path. This makes the terminal easier to read, especially in workshop settings. + +The command is idempotent—it only adds the `PS1` export line to `~/.bashrc` if it's not already present, so restarting the Codespace won't create duplicate lines. + +### How to Override + +If you prefer a different prompt, you can: + +1. **Edit `~/.bashrc` directly**: Modify or remove the `export PS1='\W\$ '` line and add your preferred prompt setting. + +2. **Use a custom dotfiles repo**: Configure your [GitHub Codespaces dotfiles](https://docs.github.com/en/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles) to set your preferred `PS1` value. Your dotfiles will take precedence. + +### How to Revert + +To remove this feature from the repository, delete the `postStartCommand` line from `devcontainer.json`. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c0a5c78..03ffbad 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -26,7 +26,9 @@ }, "extensions": [ "ms-vscode.live-server", - ] + ], + // Use 'postStartCommand' to configure a shorter terminal prompt for Codespaces. + "postStartCommand": "grep -qxF \"export PS1='\\\\W\\\\$ '\" ~/.bashrc || echo \"export PS1='\\\\W\\\\$ '\" >> ~/.bashrc" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. From 146b8ccddf63aa3711487cb7d5751d6eb4312fb9 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Tue, 2 Dec 2025 10:37:32 -0700 Subject: [PATCH 3/3] Apply suggestion from @lwasser --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 03ffbad..03f8679 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,8 +27,8 @@ "extensions": [ "ms-vscode.live-server", ], - // Use 'postStartCommand' to configure a shorter terminal prompt for Codespaces. - "postStartCommand": "grep -qxF \"export PS1='\\\\W\\\\$ '\" ~/.bashrc || echo \"export PS1='\\\\W\\\\$ '\" >> ~/.bashrc" + # Simplify bash prompt + "postStartCommand": "grep -qxF \"export PS1='\\$ '\" ~/.bashrc || echo \"export PS1='\\$ '\" >> ~/.bashrc" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally.