FROM ubuntu:24.04

# Install dependencies
RUN apt-get update && apt-get install -y \
    tmux \
    screen \
    git \
    automake \
    autoconf \
    make \
    gcc \
    gawk \
    python3 \
    && rm -rf /var/lib/apt/lists/*

# Copy byobu source
COPY . /tmp/byobu-src
WORKDIR /tmp/byobu-src

# Build and install
RUN ./autogen.sh && \
    ./configure --prefix=/usr --sysconfdir=/etc && \
    make && \
    make install

# Create a test user
RUN useradd -m -s /bin/bash testuser

# Set up byobu for test user
USER testuser
WORKDIR /home/testuser

# Enable byobu by default
RUN byobu-launcher-install

CMD ["/bin/bash", "-l"]
