Merge pull request #2254 from akruphi/hist_footer
[far2l.git] / README.md
blob95cbfbd408577476935deea769fa4cb02de1f6bd
1 [![Cirrus Build Status](https://api.cirrus-ci.com/github/elfmz/far2l.svg)](https://cirrus-ci.com/github/elfmz/far2l) [![Coverage Status](https://codecov.io/gh/elfmz/far2l/coverage.svg?branch=master)](https://codecov.io/gh/elfmz/far2l?branch=master) [![Coverity Scan](https://scan.coverity.com/projects/27038/badge.svg)](https://scan.coverity.com/projects/elfmz-far2l) [![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/elfmz/far2l.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/elfmz/far2l/context:cpp) [![Packages](https://repology.org/badge/tiny-repos/far2l.svg)](https://repology.org/project/far2l)
3 # far2l [![tag](https://img.shields.io/github/tag/elfmz/far2l.svg)](https://github.com/elfmz/far2l/tags)
4 Linux fork of FAR Manager v2 (http://farmanager.com/)   
5 Works also on OSX/MacOS and BSD (but latter not tested on regular manner)   
6 BETA VERSION.   
7 **Use on your own risk!**
9 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)
11 FreeBSD/MacOS (Cirrus CI): [![Cirrus](https://api.cirrus-ci.com/github/elfmz/far2l.svg)](https://cirrus-ci.com/github/elfmz/far2l)
14 #### License: GNU/GPLv2
16 ### Used code from projects
18 * FAR for Windows and some of its plugins
19 * WINE
20 * ANSICON
21 * Portable UnRAR
22 * 7z ANSI-C Decoder
23 * utf-cpp by ww898
26 ## Installing, Running
27 #### Debian/Ubuntu 23.10+ binaries (with TTY X/Xi backends only)
29 ```sh
30 apt-get install far2l
31 ```
33 Under Ubuntu Desktop 23.10 run as
34 `far2l --nodetect=xi --ee`
36 #### OSX/MacOS binaries
38 You can install prebuilt package for x86_64 platform via Homebrew Cask, by command:
39 ```sh
40 brew install --cask far2l
41 ```
43 You can also manually download and install prebuilt package for x86_64 platform from Releases page: <https://github.com/elfmz/far2l/releases>
45 #### Docker
47 You can use containers to try `far2l` without installing anything.
48 ```sh
49 docker build . -l far2l
50 docker run -it far2l
51 ```
53 See also [Community packages & binaries](#community_bins)
56 ## Building, Contributing, Hacking
57 #### Required dependencies
59 * libwxgtk3.0-gtk3-dev (or libwxgtk3.2-dev in newer distributions, or libwxgtk3.0-dev in older ones, optional - needed for GUI backend, not needed with -DUSEWX=no)
60 * libx11-dev (optional - needed for X11 extension that provides better UX for TTY backend wherever X11 is available)
61 * libxi-dev (optional - needed for X11/Xi extension that provides best UX for TTY backend wherever X11 Xi extension is available)
62 * libxerces-c-dev (optional - needed for Colorer plugin, not needed with -DCOLORER=no)
63 * libuchardet-dev (optional - needed for auto charset detection, not needed with -DUSEUCD=no)
64 * libssh-dev (optional - needed for NetRocks/SFTP)
65 * libssl-dev (optional - needed for NetRocks/FTPS)
66 * libsmbclient-dev (optional - needed for NetRocks/SMB)
67 * libnfs-dev (optional - needed for NetRocks/NFS)
68 * libneon27-dev (or later, optional - needed for NetRocks/WebDAV)
69 * libarchive-dev (optional - needed for better archives support in multiarc)
70 * libunrar-dev (optional - needed for RAR archives support in multiarc, see UNRAR command line option)
71 * libpcre3-dev (or libpcre2-dev in older distributions, optional - needed for advanced custom archive formats support in multiarc)
72 * cmake ( >= 3.2.2 )
73 * pkg-config
74 * g++
75 * git (needed for downloading source code)
77 #### Or simply on Debian/Ubuntu:
78 ``` sh
79 apt-get install libwxgtk3.0-gtk3-dev libx11-dev libxi-dev libpcre3-dev libxerces-c-dev libuchardet-dev libssh-dev libssl-dev libsmbclient-dev libnfs-dev libneon27-dev libarchive-dev cmake pkg-config g++ git
80 ```
82 A simple sid back port should be as easy as (build your own binary deb from the official source deb package):
83 ```sh
84 # you will find the latest dsc link at http://packages.debian.org/sid/far2l
85 dget http://deb.debian.org/debian/pool/main/f/far2l/far2l_2.5.0~beta+git20230223+ds-2.dsc
86 dpkg-source -x *.dsc
87 cd far2l-*/
88 debuild
89 # cd .. and install your self built far2l*.deb
90 ```
92 In older distributions: use libpcre2-dev and libwxgtk3.0-dev instead of libpcre3-dev and libwxgtk3.0-gtk3-dev
94 #### Clone and Build
95  * Clone current master
96 ```sh
97 git clone https://github.com/elfmz/far2l
98 cd far2l
99 ```
100  * Checkout some stable release tag (master considered unstable): `git checkout v_2.#.#`
101  * Prepare build directory:
102 ```sh
103 mkdir -p _build
104 cd _build
107  * Build:
108 _with make:_
109 ``` sh
110 cmake -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release ..
111 cmake --build . -j$(nproc --all)
112 ``` 
113 _or with ninja (you need **ninja-build** package installed)_
114 ``` sh
115 cmake -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release -G Ninja ..
116 cmake --build .
119  * If above commands finished without errors - you may also install far2l, `sudo cmake --install .`
121  * Also it's possible to create far2l_2.X.X_ARCH.deb or ...tar.gz packages in `_build` directory by running `cmake --build . --target package` command.
123 ##### Additional build configuration options:
125 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
127 To force-disable TTY|X and TTY|Xi backends: add argument `-DTTYX=no`; to disable only TTY|Xi - add argument `-DTTYXI=no`
129 To eliminate libuchardet requirement to reduce far2l dependencies by cost of losing automatic charset detection functionality: add -DUSEUCD=no
131 To build with Python plugin: add argument `-DPYTHON=yes`
133 To control how RAR archives will be handled in multiarc:
134  `-DUNRAR=bundled` (default) use bundled sources found in multiarc/src/formats/rar/unrar
135  `-DUNRAR=lib` use libunrar and unrar utility, also build requires libunrar-dev to be installed
136  `-DUNRAR=NO` dont use special unrar code, rar archives will be handled by libarchive unless its also disabled
138 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
140 #### OSX/MacOS build
142 To make custom/recent build use brew or MacPorts.
144  * Supported compiler: `AppleClang 8.0.0.x` or newer. Check your version, and install/update Xcode if necessary.
145  ```sh
146  clang++ -v
147  ```
148  * If you want to build using Homebrew - first visit <https://brew.sh/> for installation instructions. Note that there're reported problems with Homebrew-based build under MacOS Big Sur.
149  * If you want to build using MacPorts - first visit <https://www.macports.org/install.php> for installation instructions.
151 ##### One line OSX/MacOS install latest far2l git master via unofficial brew tap
153  * With GUI/TTY backends:
154 ```sh
155 brew install --HEAD yurikoles/yurikoles/far2l
157  * With TTY backend only:
158 ```sh
159 brew install --HEAD yurikoles/yurikoles/far2l --without-wxwidgets
161  * Additionally you can enable python support by adding `--with-python@3.10` to the one of two above commands.
163 ##### Full OSX/MacOS build from sources (harder):
164 Some issues can be caused by conflicting dependencies, like having two versions of wxWidgets, so avoid such situation when installing dependencies.
166  * Clone:
167 ```sh
168 git clone https://github.com/elfmz/far2l
169 cd far2l
171  * Install needed dependencies with MacPorts:
172 ``` sh
173 sudo port install cmake pkgconfig wxWidgets-3.2 libssh openssl xercesc3 libfmt uchardet neon
174 export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
176  * OR if you prefer to use brew packages, then:
177 ```sh
178 brew bundle -v
179 export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix)/opt/openssl/lib/pkgconfig:$(brew --prefix)/opt/libarchive/lib/pkgconfig"
181  * After dependencies installed - you can build far2l:
182 _with make:_
183 ```sh
184 mkdir _build
185 cd _build
186 cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release ..
187 cmake --build . -j$(sysctl -n hw.logicalcpu)
188 ``` 
189 _or with ninja:_
190 ```sh
191 mkdir _build
192 cd _build
193 cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release -G Ninja ..
194 cmake --build .
196  * Then you may create .dmg package by running: `cpack` command.
197 Note that this step sometimes fails and may succeed from not very first attempt.
198 Its recommended not to do anything on machine while cpack is in progress.
199 After .dmg successfully created, you may install it by running `open ...path/to/created/far2l-*.dmg`
201 ##### macOS workaround if far2l in macOS regularly asks permission to folders
202 After command
204  sudo codesign --force --deep --sign - /Applications/far2l.app
206 it is enough to confirm permission only once.
208 Details see in [`issue`](https://github.com/elfmz/far2l/issues/1754).
210 #### Building on Gentoo (and derivatives)
211 For absolute minimum you need:
213 emerge -avn dev-libs/xerces-c app-i18n/uchardet dev-util/cmake
215 If you want to build far2l with wxGTK support also install it:
217 emerge -avn x11-libs/wxGTK
219 Additionally, for NetRocks you will need:
221 emerge -avn net-libs/neon net-libs/libssh net-fs/libnfs net-fs/samba
223 After installing, follow Clone and Build section above.
225 #### Installing and Building on [NixOS](https://nixos.org/)
227 To install system-wide, add the `far2l` package to your [`configuration.nix`](https://nixos.org/manual/nixos/stable/index.html#sec-changing-config) `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](https://wiki.nixos.org/wiki/Nix_channels).
229 The Far2l adaptation for _nix_ is [a small file on GitHub](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/far2l/default.nix), 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.
231 You can build and run `far2l` package for any revision:
232 * Directly from GitHub (`NixOS/nixpkgs` repo, or your own fork and branch):
233  ``` sh
234 nix-shell -I nixpkgs=https://github.com/<fork>/nixpkgs/archive/<revision-or-branch>.tar.gz -p far2l --command far2l
235  ```
236 * From a locally cloned working directory of the repo:
237 ``` sh
238 nix-shell -I nixpkgs=/path/to/nixpkgs -p far2l --command far2l
241 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.
243 #### IDE Setup
244 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.
246  * **QtCreator**: select "Open Project" and point QtCreator to the CMakeLists.txt in far2l root directory
247  * **CLion**: the same as **QtCreator**.
248  * **CodeLite**: use this guide to setup a project: https://wiki.codelite.org/pmwiki.php/Main/TheCMakePlugin (to avoid polluting your source tree, don't create your workspace inside of the far2l directory)
249  * **Visual Studio Code** (required _CMake Tools extension_): open far2l root directory (by default building in subdirectory `_build`; you can change in `.vscode/settings.json`)
251 ### Terminals and SSH clients
252 Supporting extended far2l keyboard shortcuts and clipboard access
254  * **kovidgoyal's kitty** (Linux, macOS, *BSD): https://github.com/kovidgoyal/kitty & https://sw.kovidgoyal.net/kitty (TTY|k backend: keys by kovidgoyal's kitty keyboard protocol; turn on OSC 52 in far2l and kitty for clipboard support)
255  * **Wez's Terminal Emulator** (Linux, FreeBSD, Windows): https://github.com/wez/wezterm & https://wezfurlong.org/wezterm (TTY|k backend: keys in Linux, FreeBSD by kovidgoyal's kitty keyboard protocol; TTY|w backend: keys in Windows by win32-input-mode, enabled by default; turn on OSC 52 for clipboard support) [kitty keyboard protocol not supported in macOS & Windows]
256  * **iTerm2** (macOS): https://gitlab.com/gnachman/iterm2 & https://iterm2.com (TTY|a backend: keys by iTerm2 "raw keyboard" protocol; turn on OSC 52 for clipboard support)
257  * **Windows Terminal** (TTY|w backend: keys by win32-input-mode; turn on OSC 52 for clipboard support; has mouse bug: https://github.com/microsoft/terminal/issues/15083 )
259  * _Original Putty_ does _not correctly send some keyboard shortcuts_. Please use putty forks with _special far2l TTY extensions support (fluent keypresses, clipboard sharing etc)_:
260    * **putty4far2l** (Windows ssh-client): https://github.com/ivanshatsky/putty4far2l/releases & https://github.com/unxed/putty4far2l (TTY|F backend: keys and clipboard by FAR2L TTY extensions support)
261    * **cyd01's KiTTY** (Windows ssh-client): https://github.com/cyd01/KiTTY & https://www.9bis.net/kitty (TTY|F backend: keys and clipboard by FAR2L TTY extensions support)
262    * **putty-nd** (Windows ssh-client): https://sourceforge.net/projects/putty-nd & https://github.com/noodle1983/putty-nd (TTY|F backend: keys and clipboard by FAR2L TTY extensions support)
264 ### Useful 3rd-party extras
266  * A collection of macros for far2l: https://github.com/corporateshark/far2l-macros
267  * Turbo Vision, TUI framework supporting far2l terminal extensions: https://github.com/magiblot/tvision
268  * turbo, text editor supporting far2l terminal extensions: https://github.com/magiblot/turbo
269  * Tool to import color schemes from windows FAR manager 2 .reg format: https://github.com/unxed/far2ltricks/blob/main/misc/far2l_import.pl
271  * **Community wiki & tips** (in Russian; unofficial): https://github.com/akruphi/far2l/wiki
273 <a name="community_bins"></a>
274 ### Community packages & binaries
276  _They are mainteined by enthusiasts and may be not exact with master: sometimes has extra plugins, sometimes has tweak, etc._
278  * **Portable** (_with TTY X/Xi backend_) | **AppImage** (_with wx-GUI and some extra plugins_): https://github.com/spvkgn/far2l-portable/releases
279  * **Ubuntu** and **Mint** from PPA with fresh far2l: https://launchpad.net/~far2l-team/+archive/ubuntu/ppa
280  * **Fedora** and **CentOS**: https://copr.fedorainfracloud.org/coprs/polter/far2l
281  * **OpenSUSE**, **Fedora**, **Ubuntu**: https://download.opensuse.org/repositories/home:/viklequick/
282  * **OpenWrt**: https://github.com/spvkgn/far2l-openwrt
283  * **Termux**: https://github.com/spvkgn/far2l-termux
284  * **Flatpak**: https://github.com/spvkgn/far2l-flatpak (access only to part of real filesystem via sandbox)
286  See also in https://github.com/elfmz/far2l/issues/647
288 ## Notes on porting and FAR Plugin API changes
289  * See [HACKING.md](HACKING.md)
291 ## Testing
292  * See [testing/README.md](testing/README.md)
294 ## Known issues:
295 * Only valid translations are English, Russian, Ukrainian and Belarussian (interface only), all other languages require deep correction.