Home

Awesome

far2m

A fork of far2l (https://github.com/elfmz/far2l)

Linux fork of FAR Manager v2 (http://farmanager.com/)

Works also on OSX/MacOS and BSD (but later not tested on regular manner)

BETA VERSION. Use at your own risk!

Included plug-ins

Advanced compare, Align block, Auto wrap, Calculator, Draw lines, EditCase, Editor autocomplete, FarColorer, FileCase, HlfViewer, Incremental search, Inside, LuaMacro, MultiArc, NetCfg, NetRocks (SFTP/SCP/FTP/FTPS/SMB/NFS/WebDAV), Python (optional scripting support), SimpleIndent, TmpPanel.

License: GNU/GPLv2

Used code from projects

Contributing, Hacking

Required dependencies

Or simply on Debian/Ubuntu:

apt-get install gawk m4 libwxgtk3.0-gtk3-dev libx11-dev libxi-dev libxml2-dev libuchardet-dev libssh-dev libssl-dev libsmbclient-dev libnfs-dev libneon27-dev libarchive-dev libluajit-5.1-dev uuid-dev cmake g++ git

In older distributives: use libwxgtk3.0-dev instead of libwxgtk3.0-gtk3-dev

Clone and Build

mkdir -p far2m/_build
cd far2m/_build
cmake -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc --all)

or with ninja (you need ninja-build package installed)

cmake -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release -G Ninja ..
ninja
Additional build configuration options:

To build without WX backend (console version only): change -DUSEWX=yes to -DUSEWX=no also in this case dont need to install libwxgtk*-dev package

To force-disable TTY|X and TTY|Xi backends: add argument -DTTYX=no; to disable only TTY|Xi - add argument -DTTYXI=no

To eliminate libuchardet requirement to reduce far2m dependencies by cost of losing automatic charset detection functionality: add -DUSEUCD=no

By default far2m uses pre-generated "hardcoded" UNICODE characters properties. But this can be changed by specifying -DICU_MODE when configuring cmake: -DICU_MODE=prebuilt - is a described above default implementaion. Most dependency-less option. -DICU_MODE=build - re-generate characters properties during build by using libicu available on build system, but it still not required to be present on target. -DICU_MODE=runtime - obtain properties at runtime (that can be bit slower) using libicu that required to be present on target system.

To build with Python plugin: add argument -DPYTHON=yes but you must have installed additional packages within yours system: python3-dev, python3-cffi

There're also options to toggle other plugins build in same way: ALIGN AUTOWRAP CALC COLORER COMPARE DRAWLINE EDITCASE EDITORCOMP FARFTP FILECASE INCSRCH INSIDE MULTIARC NETROCKS SIMPLEINDENT TMPPANEL

Useful 3rd-party extras

Notes on porting

I (elfmz) implemented/borrowed from WINE some commonly used WinAPI functions. They are all declared in WinPort/WinPort.h and corresponding defines can be found in WinPort/WinCompat.h (both are included by WinPort/windows.h). Note that this stuff may not be 1-to-1 to corresponding Win32 functionality also doesn't provide full-UNIX functionality, but it simplifies porting and can be considered as temporary scaffold.

However, only the main executable is linked statically to WinPort, although it also exports WinPort functionality, so plugins use it without the neccessity to bring their own copies of this code. This is the reason that each plugin's binary should not statically link to WinPort.

While FAR internally is UTF16 (because WinPort contains UTF16-related stuff), native Linux wchar_t size is 4 bytes (rather than 2 bytes) so potentially Linux FAR may be fully UTF32-capable console interaction in the future, but while it uses Win32-style UTF16 functions it does not. However, programmers need to be aware that wchar_t is not 2 bytes long anymore.

Inspect all printf format strings: unlike Windows, in Linux both wide and multibyte printf-like functions have the same multibyte and wide specifiers. This means that %s is always multibyte while %ls is always wide. So, any %s used in wide-printf-s or %ws used in any printf should be replaced with %ls.

Update from 27aug: now it's possible by defining WINPORT_DIRECT to avoid renaming used Windows API and also to avoid changing format strings as swprintf will be intercepted by a compatibility wrapper.

Plugin API

Plugins API based on FAR Manager v2 plus following changes:

Added following entries to FarStandardFunctions:

Added following commands into FILE_CONTROL_COMMANDS:

Added following plugin-exported functions:

Added following dialog messages:

Known issues: