elfmz / far2l

Linux port of FAR v2
GNU General Public License v2.0
1.8k stars 173 forks source link
filemanager linux macos osx terminal

Cirrus Build Status Coverage Status Coverity Scan Language Grade: C/C++ Packages

far2l tag

Linux fork of FAR Manager v2 (http://farmanager.com/)
Works also on OSX/MacOS and BSD (but latter not tested on regular manner)
BETA VERSION.
Use on your own risk!

Plug-ins that are currently working: NetRocks (SFTP/SCP/FTP/FTPS/SMB/NFS/WebDAV), colorer, multiarc, tmppanel, align, autowrap, drawline, editcase, SimpleIndent, Calculator, Python (optional scripting support)

FreeBSD/MacOS (Cirrus CI): Cirrus

License: GNU/GPLv2

Used code from projects

Note: Far2l uses keyboard shortcurts in the tradition of the Far Manager for Windows, but some of them (Alt-F1, Alt-F2, Alt-F7, Ctrl-arrows, etc.) usually exclusively used in desktop environment GNOME, KDE, Xfce, macOS etc. and in terminal emulators. To work with these keys in far2l you need to release keyboard shortcuts globally in the environment settings (see #2326) or use far2l lifehacks: Sticky controls via Ctrl-Space or Alt-Space or Exclusively handle hotkeys option in the Input settings (see details in buil-in far2l help).

UI Backends

FAR2L has base UI Backends (see details in build-in help section UI backends):

Mode
(UI Backends)
TTY
(plain far2l)
TTY\ X TTY\ Xi GUI
Works: in console
and in any
terminal
in terminal
window

under graphic
X11 session
in terminal
window

under graphic
X11 session
in Desktop
environment

(X11
or Wayland
or macOS)
via wxWidgets
Binaries: far2l far2l
far2l_ttyx.broker
far2l
far2l_ttyx.broker
far2l
far2l_gui.so
Dependencies: minimal + libx11 + libx11, libxi + wxWidgets, GTK
Keyboard: Typical terminals:
only essential
key combinations


KiTTY (putty fork),
kitty (*nix one),
iTerm2,
Windows Terminal,
far2l’s VT: full support
Typical terminals:
only essential
key combinations


KiTTY (putty fork),
kitty (*nix one),
iTerm2,
Windows Terminal,
far2l’s VT: full support
Typical terminals:
most of key
combinations under x11
;
only essential key
combinations
under Wayland


KiTTY (putty fork),
kitty (*nix one),
iTerm2,
Windows Terminal,
far2l’s VT: full support
All key
combinations
Clipboard
access:
Typical terminals:
via command line
tools like xclip

kitty (*nix one),
iTerm2:
via OSC52

Windows Terminal:
via OSC52
or via command line
tools under WSL


KiTTY (putty fork),
far2l’s VT:
via far2l extensions
Typical terminals,
kitty (*nix one):
via x11 interaction

iTerm2:
via OSC52

Windows Terminal:
via OSC52
or via command line
tools under WSL


KiTTY (putty fork),
far2l’s VT:
via far2l extensions
Typical terminals,
kitty (*nix one):
via x11 interaction

iTerm2:
via OSC52

Windows Terminal:
via OSC52
or via command line
tools under WSL


KiTTY (putty fork),
far2l’s VT:
via far2l extensions
via
wxWidgets API

via command line
tools under WSL
Typical
use case:
Servers,
embedded
(*wrt, etc)
Run far2l in
favorite terminal
but with
better UX
Run far2l in
favorite terminal
but with
best UX
Desktop
Debian packages: none
(use far2l due to
auto downgrade)
far2l far2l far2l-wx
(since 2.6.4)
Ubuntu packages: none
(use far2l due to
auto downgrade)
far2l far2l none
Community PPA: far2l far2l-ttyx far2l-ttyx far2l-gui

Note: When running far2l automatically downgrade if its components are not installed (or system libs are not available): GUITTY|XiTTY|XTTY. To force run only specific backend use in command line: for GUI: far2l --notty; for TTY|Xi use in command line: far2l --tty; for TTY|X: far2l --tty --nodetect=xi; for plain TTY: far2l --tty --nodetect=x (see details via far2l --help).

Note about use OSC 52 in TTY/TTY|X: to interact with the system clipboard you must not forget to enable OSC 52 in both the FAR2L settings (OptionsInterface settingsUse OSC52 to set clipboard data, which shown in the dialog only if far2l run in TTY/TTY|X mode and all other options for clipboard access are unavailable; you can run far2l --tty --nodetect to force not use others clipboard options), and in terminal settings option OSC 52 must be allowed (by default, OSC 52 is disabled in some terminals for security reasons; OSC 52 in many terminals is implemented only for the copy mode, and paste from the terminal goes by bracketed paste mode).

Installing, Running

Debian/Ubuntu binaries from the official repositories

Debian has far2 in sid-unstable / 13 trixie-testing / 12 bookworm-backports; Ubuntu since 23.10. Details about versions in the official repositories see in https://packages.debian.org/search?keywords=far2l or https://packages.ubuntu.com/search?keywords=far2l

Note: binaries in official repositories may be very outdated, actual binaries or portable see in Community packages & binaries.

Backport official packages for old Debian/Ubuntu system A simple sid back port should be as easy as (build your own binary deb from the official source deb package, required install [dependencies](#required-dependencies)): ```sh # you will find the latest dsc link at http://packages.debian.org/sid/far2l dget http://deb.debian.org/debian/pool/main/f/far2l/2.6.3~beta+ds-1.dsc dpkg-source -x *.dsc cd far2l-*/ debuild # cd .. and install your self built far2l*.deb ```

OSX/MacOS binaries

You can install prebuilt package for x86_64 platform via Homebrew Cask, by command:

brew install --cask far2l

You can also manually download and install prebuilt package for x86_64 platform from Releases page: https://github.com/elfmz/far2l/releases

Docker

You can use containers to try far2l without installing anything.

docker build . -l far2l
docker run -it far2l

See also Community packages & binaries

Building, Contributing, Hacking

Required dependencies

or simply on Debian/Ubuntu:

apt-get install libwxgtk3.0-gtk3-dev libx11-dev libxi-dev libpcre2-dev libxml2-dev libuchardet-dev libssh-dev libssl-dev libsmbclient-dev libnfs-dev libneon27-dev libarchive-dev cmake pkg-config g++ git

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

Clone and Build

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 far2l dependencies by cost of losing automatic charset detection functionality: add -DUSEUCD=no

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

To control how RAR archives will be handled in multiarc: -DUNRAR=bundled (default) use bundled sources found in multiarc/src/formats/rar/unrar -DUNRAR=lib use libunrar and unrar utility, also build requires libunrar-dev to be installed -DUNRAR=NO dont use special unrar code, rar archives will be handled by libarchive unless its also disabled

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

OSX/MacOS build

To make custom/recent build use brew or MacPorts.

One line OSX/MacOS install latest far2l git master via unofficial brew tap
Full OSX/MacOS build from sources (harder):

Some issues can be caused by conflicting dependencies, like having two versions of wxWidgets, so avoid such situation when installing dependencies.

macOS workaround if far2l in macOS regularly asks permission to folders

After command

 sudo codesign --force --deep --sign - /Applications/far2l.app

it is enough to confirm permission only once.

Details see in issue.

Building on Gentoo (and derivatives)

For absolute minimum you need:

emerge -avn dev-libs/libxml2 app-i18n/uchardet dev-util/cmake

If you want to build far2l with wxGTK support also install it:

emerge -avn x11-libs/wxGTK

Additionally, for NetRocks you will need:

emerge -avn net-libs/neon net-libs/libssh net-fs/libnfs net-fs/samba

After installing, follow Clone and Build section above.

Installing and Building on NixOS

To install system-wide, add the far2l package to your configuration.nix environment.systemPackages list. To run the application on-demand without affecting the system state, execute nix-shell -p far2l --command far2l. These use a package version from your current channel.

The Far2l adaptation for nix is a small file on GitHub, it tells which Git revision from Far2l repo to fetch, with what dependencies to build it, and how to patch its references to other software to make it run in isolated fashion independently from other versions available in the system.

You can build and run far2l package for any revision:

To advance the package to a new Far2l revision, edit the fetchFromGitHub set attributes rev (revision hash) and sha256 (revision content hash). Important! If you leave the old content hash, the old cached content for that hash might be used without attempting to download the new revision. If you're not expecting the build to break, the easiest would be to make a fork, push the change, and build straight from github.

IDE Setup

You can import the project into your favourite IDE like QtCreator, CodeLite, or any other, which supports cmake or which cmake is able to generate projects for.

Terminals and SSH clients

Supporting extended far2l keyboard shortcuts and clipboard access

Note: to full transfer extended keyboard shortcuts and the clipboard to/from the remote far2l one of the best way to initiate the connection inside local far2l-GUI (see details in build-in help section UI backends).

Useful 3rd-party extras

Community packages & binaries

They are mainteined by enthusiasts and may be not exact with master: sometimes has extra plugins, sometimes has tweak, etc.

Notes on porting and FAR Plugin API changes

Testing

Known issues: