Midnight Commander Opening/Viewing Zip-Files uses XDG-OPEN instead of unzip

Since updating from mc-4.8.26-1 to mc-4.8.28-1, midnight commander stops using internal zip-viewer script and uses XDG-OPEN instead, effectively opening the “Archive-Viewer (Engrampa)” on Xfce instead of opening the zip-view inside mc-terminal.

This seems to be a bug, because the scripts indicates the old behavior should still be desired:

From /usr/lib/mc/ext.d/archive.sh in version 5.8.28:

# $1 - action
# $2 - type of file
# $3 - pager

action=$1
filetype=$2
pager=$3

[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"

do_view_action() {
#...
        zip)
        unzip -v "${MC_EXT_FILENAME}" 2> /dev/null || \
            7za l "${MC_EXT_FILENAME}" 2> /dev/null
        ;;
#...
}

do_open_action() {
    filetype=$1
    pager=$2
#....
    zip)
        unzip -v "${MC_EXT_FILENAME}" 2> /dev/null || \
            7za l "${MC_EXT_FILENAME}" 2> /dev/null
        ;;
#...
}

case "${action}" in
view)
    do_view_action "${filetype}"
    ;;
open)
    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
        do_open_action "${filetype}" "${pager}"
    ;;
*)
    ;;
esac

from ~/.config/mc.ext (not modified by me):

#...
# zip
shell/i/.zip
	Open=%cd %p/uzip://
	View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view zip
#...

It somehow seems that the archive.sh script is not even be called…
Unfortunately I haven’t got more time to investigate in this.

Workaround for now is to install version 4.26 from pacman cache:
pacman -U mc-4.8.26-1-x86_64.pkg.tar.zst

Related to: Midnight Commander (mc) and Opening/Viewing zip files / Applications & Desktop Environments / Arch Linux Forums

The official bug report: https://midnight-commander.org/ticket/4368

All I can say is:
your /usr/lib/mc/ext.d/archive.sh is different from mine - even though we use the same version of mc

the do_open_action() in my file does not mention or handle zip files - just the do_view_action() does
this it what it looks like, all of it:

do_open_action() {
    filetype=$1
    pager=$2

    case "${filetype}" in
    bzip2)
        bzip2 -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    bzip)
        bzip -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    gz)
        gz -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    lz)
        lzip -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    lz4)
        lz4 -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    lzma)
        lzma -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    xz)
        xz -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    zst)
        zstd -dc "${MC_EXT_FILENAME}" | ${pager}
        ;;
    par2)
        par2 r "${MC_EXT_FILENAME}"
        ;;
    *)
        ;;
    esac
}

and, of course, it works as it always has - opens zip files with the internal viewer just like it has always been

cannot replicate

Oh sorry, I forgot to mention that the snippets from archive.sh are from version 5.8.28, I’m going to correct this in the original post.

My current archive.sh looks the same as yours in the 5.8.26 version.