charmbracelet / charmbracelet/bubbles
UI renders garbled characters over SSH when deployed in Docker scratch image (after upgrading from V1 to V2)
- Dominant language
- Go
- Stars
- 8.9k
- Forks
- 457
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 5
Description
**Describe the bug**
After upgrading from Bubbles V1 to V2, the UI renders incorrectly when the application is deployed inside a Docker scratch image and accessed via SSH. The UI works perfectly fine when run locally on Windows with the same terminal setup.
**Setup**
Please complete the following information along with version numbers, if applicable.
- OS: Windows (local) / scratch Docker image (server)
- Shell: PowerShell
- Terminal Emulator: Windows Terminal
- Terminal Multiplexer: N/A
- Locale: en_US.UTF-8
**To Reproduce**
Steps to reproduce the behavior:
1. Clone repo https://git.fossy.my.id/bagas/tunnel-please at branch broken-tea
2. Build the application using a Docker scratch base image
3. Run the container and expose SSH access
4. SSH into the server
5. Observe that the UI renders garbled box/block characters instead of styled text
**Source Code**
Full source code can be found at: https://git.fossy.my.id/bagas/tunnel-please/src/branch/broken-tea/
**Expected behavior**
The UI should render correctly over SSH in a Docker scratch environment, matching the local rendering. This worked correctly with Bubbles V1 under the exact same setup.
**Screenshots**
Add screenshots to help explain your problem.
https://github.com/user-attachments/assets/048d0ee4-2d3c-4bef-9956-4c0d8b4f9d87
**Additional context**
- The issue is a regression from V1 → V2; V1 worked correctly in the same Docker scratch + SSH setup
- Dockerfile for building the server
```Dockerfile
FROM golang:1.26.0-alpine AS go_builder
ARG VERSION=dev
ARG BUILD_DATE=unknown
ARG COMMIT=unknown
RUN apk update && apk upgrade && \
apk add --no-cache ca-certificates tzdata git ncurses-terminfo-base && \
update-ca-certificates
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go mod download && go mod verify
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=linux \
go build -trimpath \
-ldflags="-w -s \
-X tunnel_pls/internal/version.Version=${VERSION} \
-X tunnel_pls/internal/version.BuildDate=${BUILD_DATE} \
-X tunnel_pls/internal/version.Commit=${COMMIT}" \
-o /app/tunnel_pls \
.
RUN adduser -D -u 10001 -g '' appuser && \
mkdir -p /app/certs/ssh /app/certs/tls && \
chown -R appuser:appuser /app
FROM scratch
ARG VERSION=dev
ARG BUILD_DATE=unknown
ARG COMMIT=unknown
COPY --from=go_builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=go_builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=go_builder /etc/passwd /etc/passwd
COPY --from=go_builder /etc/group /etc/group
COPY --from=go_builder --chown=appuser:appuser /app /app
COPY --from=go_builder /etc/terminfo /etc/terminfo
WORKDIR /app
USER appuser
ENV TZ=Asia/Jakarta
ENV TERM=xterm-256color
ENV LANG=en_US.UTF-8
ENV COLORTERM=truecolor
EXPOSE 2200 8080 8443
LABEL org.opencontainers.image.title="Tunnel Please" \
org.opencontainers.image.description="SSH-based tunnel server" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${COMMIT}" \
org.opencontainers.image.created="${BUILD_DATE}"
ENTRYPOINT ["/app/tunnel_pls"]
```
Contributor guide
Assessment
This issue has not been assessed yet.