Hey - first, let’s say I would have preferred the ability to submit this bug report on the repo directly: GitHub - discourse/discourse_theme: CLI helper for developing Discourse themes - because I’m not sure I’m in the right place here?
discourse_theme is a Ruby tool and as I don’t want Ruby on my computer. And as I want homogeneous Ruby versions across my whole team, I did this Docker image:
# syntax = docker/dockerfile:1.10
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.4.2
ARG ALPINE_VERSION=3.20
FROM ruby:$RUBY_VERSION-alpine${ALPINE_VERSION}
# Install packages
RUN --mount=type=cache,id=dev-apk-cache,sharing=locked,target=/var/cache/apk \
--mount=type=cache,id=dev-apk-lib,sharing=locked,target=/var/lib/apk \
apk add \
ca-certificates \
bash \
tzdata \
xz-libs \
gcompat \
zstd-libs \
libpq
RUN gem install discourse_theme
ENTRYPOINT ["discourse_theme"]
I can run it like this:
# BUILD first
docker build -t discourse_theme:latest .
# RUN WATCH
docker run -i -t --rm -v $(pwd):/root -w /root discourse_theme:latest watch .
The issue I want to report here is about the CLI interactivity.
There is no keyboard interactivity while in Docker.
I see this when running:
If I tap an arrow key the help message goes away, but the green “selected” option never moves:
So I think this is a bug in the Gem. It detected a keypress, but it did not move the selection. I tested a lot of keypress.
Another test I did was running bash in the image, and launching discourse_theme from there, but it’s the same issue.
$ docker run -it --rm -v $(pwd):/root -w /root --entrypoint /bin/bash discourse_theme:latest
9f5736f3265e:~# discourse_theme watch .
Is that normal behavior for Ruby CLI tools or is there a bug? Thanks