dive
dive copied to clipboard
Fix error on Layer section and reduce information on one line per step.
When scrolling through commands in Layers section, in the case of multiline commands, the user could cause an index out of bounds error by scrolling to much. Here is an example:

and Dockerfile used is as follows:
# syntax=docker/dockerfile:1.3-labs
FROM archlinux
RUN <<-EOF
echo "Look what they've done to my line, it's ruined! Ruined, I tell ya! Because maybe I have a wide monitor that can fit more than 50 chars so I shall not be hindered by mere mortals!
cd /tmp
cd /
EOF
WORKDIR /home/bajo
It's hard to see, but when the user just presses down, at one point it panics from dive.exe.
Therefore multiline is now limited to just one line, as it also seems redundant to have the same information in Layers and Layers Details sections.
Potentially related: https://github.com/wagoodman/dive/issues/328#issuecomment-949824600
I'm seeing this with my use of HEREDOC multi-line commands. Seems that the dive layer list doesn't size correctly, and scrolls "off-screen", and then crashes when scrolling too far.