Skip to content

Strange bash chars are printed after opening a shell in devcontainer #2577

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

Open
irizzant opened this issue Apr 9, 2025 · 0 comments
Open
Labels
bug Something isn't working triage Issue needs triage

Comments

@irizzant
Copy link

irizzant commented Apr 9, 2025

What happened?

I have generated a devcontainer file with devbox generate devcontainer starting from the attached devbox json.

This is the generated devcontainer:

{
  "name": "Devbox Remote Container",
  "build": {
    "dockerfile": "./Dockerfile",
    "context": ".."
  },
  "customizations": {
    "vscode": {
      "settings": {},
      "extensions": [
        "jetpack-io.devbox",
        "github.vscode-github-actions",
        "eamodio.gitlens",
        "GitHub.vscode-pull-request-github",
        "jawandarajbir.react-vscode-extension-pack"
      ]
    }
  },
  "remoteUser": "devbox"
}

This is the Dockerfile:

FROM jetpackio/devbox:latest

# Installing your devbox project
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} backstage backstage



RUN devbox run -- echo "Installed Packages."

RUN devbox shellenv --init-hook >> ~/.profile

When I open the devcontainer I get:

\[\]\[\]\[\]devbox@771da220af86\[\]:\[\]/workspaces/backstage\[\]$ \[\]

Please note the \[\]$ \[\] and \[\]\[\]\[\].

When I then run devbox shell these chars go away and I get:

Starting a devbox shell...
(devbox) devbox@09a6ebd1546a:/workspaces/backstage$

Steps to reproduce

Command

generate

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.0/.schema/devbox.schema.json",
  "packages": [
    "nushell@latest",
    "nodejs@20"
  ],
  "shell": {
    "init_hook": [
      "chmod +x backstage",
      "export PATH=$PATH:$PWD"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  },
  "env": {
    "DEVBOX_COREPACK_ENABLED": "true"
  }
}

Devbox version

0.14.0

Nix version

nix (Nix) 2.28.1

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

@irizzant irizzant added bug Something isn't working triage Issue needs triage labels Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

1 participant