Skip to content

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

Open
@irizzant

Description

@irizzant

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions