Skip to content

[Bug]: can't run codex inside a container #305

@mwotton

Description

@mwotton

What happened?

by default, codex uses ANSI scroll escapes.

this can be replicated by running

printf '\033c\033[2;3r\033[2;1HAB\nCD\n\033[999S\033[r'

inside a "cu terminal" session.

it crashes out of the terminal with a midterm error.

can get around it by telling codex not to use ANSI but it's not a great experience.

➜ cat .container-use/environment.json
{
  "workdir": "/workdir",
  "base_image": "node:20-bookworm",
  "setup_commands": [
    "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ripgrep"
  ],
  "install_commands": [
    "npm install -g @openai/codex"
  ],
  "env": [
    "CI=1",
    "NO_COLOR=1",
    "FORCE_COLOR=0",
    "TERM=dumb",
    "PAGER=cat",
    "GIT_PAGER=cat"
  ],
  "secrets": [
    "OPENAI_API_KEY=env://OPENAI_API_KEY"
  ]
}

Version

container-use version dev (d03dc1c)

Logs

nothing interesting in logs - is a midterm bug, really, but it affects your users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions