dive icon indicating copy to clipboard operation
dive copied to clipboard

Fix error on Layer section and reduce information on one line per step.

Open lightsnowball opened this issue 3 years ago • 1 comments

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:

dive_wrong

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.

lightsnowball avatar Apr 22 '22 18:04 lightsnowball

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.

patcon avatar Jun 10 '22 01:06 patcon