Skip to content

Releases

mc-MP.v4.1.40

Choose a tag to compare

@PaLegba PaLegba released this 05 Nov 10:14

Advanced Midnight Commander mc-4.1.x-MP [by Olegarch]

Ideas and bug reports: legba@01.gg
Latest releases: http://mc.01.gg/

Version: 4.1.40-MP

Release 4.1.40-MP (2026)

This round of work focused on modernising the build, completing the UTF-8
support, restoring the character-conversion paths in the viewer and editor,
fixing the file-system extensions, and cleaning up long-standing memory
bugs.

    General:
        - RENAMED: installed programs no longer collide with mainline mc:
          mc-MP, mcedit-MP, mcview-MP, mcmfmt-MP, mcserv-MP and
          cons.saver-MP.
        - CHANGED: the install layout is now $PREFIX/bin/mc-MP,
          $PREFIX/libexec/mc-MP and $PREFIX/share/mc-MP (Haiku:
          $PREFIX/lib/mc-MP and $PREFIX/data/mc-MP).  User files live in
          ~/.config/mc-MP (Haiku: ~/config/settings/mc-MP).  Old ~/.mc
          files are not migrated automatically because that directory
          belongs to mainline mc.
        - REWORKED: the build system.
          * autoconf, generated Makefiles, Make.common and the old configure
            scripts were removed.
          * the build is now driven by config.mk and plain Makefiles
            (src, vfs, edit, slang, doc, lib).
          * config.h is a readable, static configuration file.
          * compiler header dependencies are tracked, so changing WEdit or
            WView cannot leave stale object files behind.
          * the bundled S-Lang 1.4.8 is built with its UTF-8 patch.

        - ADDED: proper UTF-8 support.
          * UTF-8 is detected from the locale and used for the terminal,
            panels, dialogs, command line, viewer and editor.
          * wide characters (CJK), emoji and combining marks are measured by
            display width, not by byte count.
          * the Unicode visual-width helpers from _deps/utf8.h are used.

        - FIXED: input cursor positioning in the command line and in every
                 dialog field.
          * the cursor was positioned by byte offset while the text was
            drawn by display columns, so it ran away on every Cyrillic
            character.
          * WInput now uses a single display-column calculation for drawing,
            scrolling, cursor placement and mouse clicks.

        - FIXED: shell prompt and label widths.
          * prompt length was calculated with strlen(), so UTF-8 box-drawing
            characters in PS1 produced a large gap before the input field.
          * control sequences (CSI/OSC) are stripped properly, prompt
            truncation respects UTF-8 boundaries, and label padding uses
            display width.

        - FIXED: the clock.
          * it displayed "??:??:??" because strftime() no longer fitted into
            an 11-byte buffer in locales such as en_US.UTF-8.
          * the buffer is now large enough and the clock uses the 24-hour
            format HH:MM:SS.

        - ADDED: legacy codepage support in the viewer and editor while the
                 terminal remains UTF-8.
          * Ctrl-T opens the source-codepage menu in both the viewer and the
            editor.
          * the menu offers Auto-detect, UTF-8 (no translation), and the
            codepage list (CP1251, CP866, KOI8-R/U and others).
          * auto-detection recognises UTF-8, CP1251, CP866, KOI8-R and
            KOI8-U.
          * codepage tables are searched in $MC_CODEPAGES, LIBDIR/codepages
            and ~/.config/mc-MP/codepages.

        - ADDED: UTF-8-aware saving in the editor.
          * files are converted to UTF-8 internally and saved back in their
            original source encoding by default.
          * the Save As dialog (F12 / Shift-F2) now contains integrated
            options for line-ending conversion (keep unchanged, LF, CR LF,
            CR) and text encoding (keep the original encoding or recode to
            the active system encoding).
          * the old separate question after the file-name prompt was
            removed.
          * viewer searches convert the search string to the file's source
            encoding.

        - FIXED: menu rendering.
          * the Command and Edit menus were too narrow because a macro with
            a ternary operator was expanded incorrectly.
          * menu width now follows the longest entry, and dropdown focus
            moves from top to bottom in the expected order.
          * the 7z rule was moved before the manual-page rule because ".7z"
            was being interpreted as a manual-page section 7.

        - FIXED: crashes after terminal resize.
          * the viewer passed an uninitialised colour array to create_dlg().
          * viewer/editor resize code assumed current->next was always the
            button bar; after menus or dialogs it could write through the
            wrong widget. The button bar is now looked up explicitly.
          * SIGWINCH no longer uses SA_RESTART, so resizing takes effect
            without pressing an extra key.

        - FIXED: the clock is refreshed on every alarm tick, so it no longer
                 freezes until the next screen repaint or user event.

        - FIXED: panel scrollbar/vertical-line colours.
          * the scrollbar thumb used the dialog reverse colour and did not
            restore the normal colour, so vertical lines below it inherited
            reverse/bright attributes.
          * the thumb now uses the selected colour and every other scrollbar
            line explicitly resets to the normal panel colour.

        - FIXED: memory management.
          * caught leaks in mount-list refreshes, syntax-file parsing, input
            and directory history, dialog lists, mc.ext loading and codepage
            loading.
          * removed overlapping strcpy() calls.
          * Valgrind no longer reports invalid reads/writes, invalid frees or
            uninitialised values in the viewer, editor, codepage, resize and
            Save As scenarios.

        - FIXED: subshell startup on Haiku and other non-Linux systems.
          * $SHELL is resolved through realpath(), so /bin/sh -> bash is
            recognised instead of silently disabling the subshell.
          * Haiku uses openpty() from libbsd; other systems keep their
            existing PTY code.
          * the pty is given normal interactive termios flags
            (ECHO/ICANON/OPOST/ONLCR), so typed commands are echoed and
            prompts return to column 0.
          * init_subshell() has a working timeout/fallback instead of
            hanging when the shell produces no prompt.
          * Ctrl-O switches back to the panels/editor while a command line
            is only partially typed; it is blocked only while a submitted
            command is actually running.
          * a command sent from mc's own command line first clears the
            pending subshell line, so the two input buffers cannot be
            concatenated accidentally.
          * POSIX sh (FreeBSD sh, NetBSD sh, dash, ash) is supported as a
            subshell: the CWD is recovered from the prompt.  FreeBSD sh
            expands \w in PS1; other sh implementations use ${PWD}.  The
            prompt itself marks command completion, so Ctrl-O works without
            PROMPT_COMMAND or a debug trap.
          * on BSD consoles Ctrl-O restores the previous shell output from a
            64 KB replay buffer instead of leaving the panel area blank; the
            replay renders CR, backspace and CSI sequences correctly and
            leaves the cursor where the shell's line editor put it.
          * PageUp and PageDown at the subshell prompt scroll through the
            replay buffer.
          * returning to the panels with Ctrl-O re-reads both directories, so
            files created or removed in the subshell appear without Ctrl-R.
          * FreeBSD has no terminfo database in the base system (only
            /etc/termcap.db, which S-Lang cannot read).  mc now uses the
            bundled old-format xterm/st entries via TERMINFO and maps
            xterm-256color/screen/tmux variants to xterm when needed, so the
            console has colours and working cursor keys without a manual
            TERM override.

        - ADDED: unified command line and subshell input.
          * a command typed on the panel command line is copied into the
            shell line when Ctrl-O enters the subshell;
          * the shell line is copied back to the panel command line when
            Ctrl-O returns, so it can be edited, completed or reused;
          * the panel insertion keys work while typing in the subshell:
            Alt-Enter (selected file), Ctrl-X p / Ctrl-X Ctrl-P (current or
            other path), Ctrl-X t / Ctrl-X Ctrl-T (tagged files) and
            Ctrl-X r / Ctrl-X Ctrl-R (symlink target);
          * commands executed in the subshell are added to mc's command
            history (Esc-H) and can be recalled later;
          * the shell's own completion and history keys still work.  A line
            on which shell completion/history was used is not added to mc's
            history, so a truncated command is never stored; the line copied
            back to the panel command line may lack the completed part.

        - FIXED: install and runtime paths.
          * changing PREFIX/LIBDIR (including on the make command line)
            now forces a rebuild via config-stamp.mk, so the installed
            binary does not keep looking in an old prefix.
          * PowerPack syntax rules and codepage tables are installed into
            $(LIBDIR)/syntax and $(LIBDIR)/codepages.

        - ADDED: compact mountpoint/free-space display.
          * sizes are shown byte-exact in B/K/M/G/T units, rounded once
            from the full value; values above T keep growing the T number.
          * Haiku uses dev_for_path()/fs_stat_dev()/...
Read more