How akruphi/far2l works
Project type and purpose
• This is a monolithic, plugin-based native file manager (“far2l”), a Linux/macOS fork of Windows FAR Manager V2. It’s written in C/C++ with a modular plugin architecture and supports multiple UI backends (console and GUI).
• The README confirms it’s a terminal/desktop application with an extensible plugin system (NetRocks, colorer, multiarc, tmppanel, compare, filecase, inside, align, autowrap, drawline, editcase, editorcomp, incsrch, SimpleIndent, Calculator, Python scripting, etc.).
File-structure analysis
• Top‐level CMakeLists.txt orchestrates building core, library modules, plugins and utilities.
• Core engine lives under far2l/src, with subfolders for base, console, dialog, macro, panels, vt, plugin host and so on.
• UI backends:
• TTY / TTY|X / TTY|Xi code under WinPort and far2l/src/console plus X11 wrappers.
• GUI (wxWidgets) under WinPort/src/Backend/WX.
• Plugins are in parallel directories at root (NetRocks, colorer, multiarc, etc.), each with its own CMakeLists, source and config files.
• Shared libraries:
• FARStdlib – common FAR-style API.
• utils – OS-abstraction and helpers.
• WinPort – Windows-compat layer reused for TTY backends.
• External dependencies are declared in README (libssh, libssl, libsmbclient, libnfs, libxml2, uchardet, AWS SDK, ICU, Python3, libarchive, libunrar, etc.).
• Core Engine
– Command dispatcher, file panels, macro engine, plugin host, configuration subsystem.
• UI Backends
– TTY, TTY|X, TTY|Xi modules (console mode)
– GUI (wxWidgets)
• Plugin Manager
– Dynamically loads plugins via FAR2L plugin API.
• Plugins
– NetRocks (network protocols)
– Colorer (syntax highlighting)
– MultiArc (archive formats)
– TmpPanel, Compare, FileCase, Inside, Align, AutoWrap, DrawLine, EditCase, EditorComp, IncSrch, SimpleIndent, Calculator, Python plugin
• Shared Libraries
– FARStdlib, Utils, WinPort
• External Libraries & Services
– libssh/openssl (SFTP/FTPS), libsmbclient (SMB), libnfs, neon (WebDAV), AWS SDK (S3), libxml2, uchardet, ICU, Python3 Interpreter/CFFI, libarchive, libunrar, 7z
• Build System & Packaging
– CMake, CI workflows, packaging scripts.
b. Relationships and interactions
• User ↔ UI Backend: keyboard/mouse input; screen output.
• UI Backend → Core Engine: translate events → core APIs.
• Core Engine → Plugin Manager: load/initialize plugins; dispatch plugin callbacks.
• Plugin → Core Engine: query panels, perform operations (list files, transfer data).
• Plugins → External Libraries: use SSH/SSL, SMB, NFS, ICU, XML parsing, archive codecs, Python runtime.
• Core Engine → Shared Libraries: use Utils & FARStdlib for OS abstractions (threading, file I/O, IPC).
• Core Engine/Plugins → OS: filesystem, network, X11/Wayland.
c. Architectural patterns and design principles
• Plugin pattern: decoupled modules implementing a plugin API.
• Strategy pattern: pluggable UI backends selected at runtime.
• Facade/adaptor: Utils and WinPort abstract OS differences.
• Modular layering: core, UI, plugins, utilities, external dependencies.
d. Key technologies and frameworks
• CMake – build orchestration
• wxWidgets – GUI backend
• X11/XInput – extended TTY backends
• libssh, OpenSSL, libsmbclient, libnfs, neon – network plugins
• ICU, libuchardet – charset handling
• libxml2 – Colorer config parsing
• AWS C++ SDK – NetRocks AWS S3
• Python/CFFI – Python plugin
• libarchive, UnRAR, 7z ANSI-C – MultiArc plugin
• WINE sources – Windows API porting