Skip to content

Commit

Permalink
Merge branch 'elfmz:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
deep-soft authored Oct 20, 2024
2 parents eccc973 + df4feaf commit bf63847
Show file tree
Hide file tree
Showing 104 changed files with 1,493 additions and 1,498 deletions.
3 changes: 3 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ Note that all true-color capable messages extend but don't replace 'base' 16 pal
(a la global parameters `Opt.ShowFilenameMarks` and `Opt.FilenameMarksAlign`):
- `OPIF_HL_MARKERS_NOSHOW` and `OPIF_HL_MARKERS_NOALIGN` (in `enum OPENPLUGININFO_FLAGS`);
- `PFLAGS_HL_MARKERS_NOSHOW` and `PFLAGS_HL_MARKERS_NOALIGN` (in `enum PANELINFOFLAGS`).
* Flag which prevents the removal of ampersand characters from menu items being iterated in `VMenu::FindItem()`
(for the proper work of `History::GetAllSimilar()` function and in other similar situations):
- `LIFIND_KEEPAMPERSAND` (in `enum FARLISTFINDFLAGS`);

55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,31 @@ FreeBSD/MacOS (Cirrus CI): [![Cirrus](https://api.cirrus-ci.com/github/elfmz/far
### UI Backends
FAR2L has base UI Backends (see details in build-in help section **UI backends**):

- **GUI** (**WX**): uses wxWidgets, works in graphics mode, ideal UX, requires a lot of X11 dependencies;
- **GUI** (**WX**): uses wxWidgets, works in graphics mode, **ideal UX**
(might add dependencies to your desktop environment, e.g. wxWidgets toolkit and related packages);

- **TTY|Xi**: works in terminal mode, requires a dependency on pair X11 libraries (to access clipboard and to get state of
all keyboard modifiers), almost perfect UX;
- **TTY|Xi**: works in terminal mode, requires a dependency on pair X11 libraries
(to access clipboard and to get state of all keyboard modifiers), **almost perfect UX**;

- **TTY|X**: works in terminal mode, uses X11 to access clipboard, all keyboard works via terminal;

- **TTY**: plain terminal mode, no X11 dependencies, UX with some restrictions (works fully when running in the [terminal
emulators](#terminals), which provide clipboard access and has their advanced keyboard-protocols).

- **TTY**: plain terminal mode, no X11 dependencies, **UX with some restrictions** (works fully when running in the
[terminal emulators](#terminals), which provide clipboard access and has their advanced keyboard-protocols).


| Mode<br>(UI Backends) | TTY<br>(plain far2l) | TTY\|X | TTY\|Xi | GUI |
| ---: | --- | --- | --- | --- |
| **Works:** | in terminal | in terminal | in terminal | in Desktop<br>environment<br><sub>(X11<br>or Wayland<br>or macOS)<br>via wxWidgets</sub> |
| **Works:** | in **console**<br>and in any<br>**terminal** | in **terminal<br>window**<br><sub>under graphic<br>X11 session</sub> | in **terminal<br>window**<br><sub>under graphic<br>X11 session</sub> | in **Desktop<br>environment**<br><sub>(X11<br>or Wayland<br>or macOS)<br>via wxWidgets</sub> |
| **Binaries:** | far2l | far2l<br>far2l_ttyx.broker | far2l<br>far2l_ttyx.broker | far2l<br>far2l_gui.so |
| **[Dependencies](#required-dependencies):** | minimal | + libx11 | + libx11, libxi | + wxWidgets, GTK |
| **Keyboard:** | <sub>_Typical terminals_:<br>**only essential<br>key combinations**<br><br>_KiTTY_ (putty fork),<br>_kitty_ (*nix one),<br>_iTerm2_,<br>_Windows Terminal_,<br>far2l’s VT: **full support**</sub> | <sub>_Typical terminals_:<br>**only essential<br>key combinations**<br><br>_KiTTY_ (putty fork),<br>_kitty_ (*nix one),<br>_iTerm2_,<br>_Windows Terminal_,<br>far2l’s VT: **full support**</sub> | <sub>_Typical terminals_:<br>**most of key<br>combinations under x11**;<br>**only essential key<br>combinations<br>under Wayland**<br><br>_KiTTY_ (putty fork),<br>_kitty_ (*nix one),<br>_iTerm2_,<br>_Windows Terminal_,<br>far2l’s VT: **full support**</sub> | **All key<br>combinations** |
| **Clipboard<br>access:** | <sub>_Typical terminals_:<br>via command line<br>tools like xclip<br><br>_kitty_ (*nix one),<br>_iTerm2_:<br>via **OSC52**<br><br>_Windows Terminal_:<br>via **OSC52**<br>or via **command line<br>tools under WSL**<br><br>_KiTTY_ (putty fork),<br>far2l’s VT:<br>via **far2l extensions**</sub> | <sub>_Typical terminals_,<br>_kitty_ (*nix one):<br>via **x11 interaction**<br><br>_iTerm2_:<br>via **OSC52**<br><br>_Windows Terminal_:<br>via **OSC52**<br>or via **command line<br>tools under WSL**<br><br>_KiTTY_ (putty fork),<br>far2l’s VT:<br>via **far2l extensions**</sub> | <sub>_Typical terminals_,<br>_kitty_ (*nix one):<br>via **x11 interaction**<br><br>_iTerm2_:<br>via **OSC52**<br><br>_Windows Terminal_:<br>via **OSC52**<br>or via **command line<br>tools under WSL**<br><br>_KiTTY_ (putty fork),<br>far2l’s VT:<br>via **far2l extensions**</sub> | via<br>**wxWidgets API**<br><br><sub>via command line<br>tools under WSL</sub> |
| **Typical<br>use case:** | **Servers**,<br>embedded | <sub>Run far2l in<br>favorite terminal<br>but with<br>**better UX**</sub> | <sub>Run far2l in<br>favorite terminal<br>but with<br>**best UX**</sub> | **Desktop** |
| **Mandatory:** | yes | no | no | no |
| **Typical<br>use case:** | **Servers**,<br>embedded<br>(*wrt, etc) | <sub>Run far2l in<br>favorite terminal<br>but with<br>**better UX**</sub> | <sub>Run far2l in<br>favorite terminal<br>but with<br>**best UX**</sub> | **Desktop** |
| [Debian](https://packages.debian.org/search?keywords=far2l) packages: | _none_<br><sup>(use `far2l` due to<br>[auto downgrade](#downgrade))</sup> | `far2l` | `far2l` | `far2l-wx`<br><sup>(since _2.6.4_)</sup> |
| [Ubuntu](https://packages.ubuntu.com/search?keywords=far2l) packages: | _none_<br><sup>(use `far2l` due to<br>[auto downgrade](#downgrade))</sup> | `far2l` | `far2l` | _none_ |
| Community [PPA](#community_bins): | `far2l` | `far2l-ttyx` | `far2l-ttyx` | `far2l-gui` |

<sub>_Note_: When running far2l automatically downgrade
<sub><a name="downgrade"></a>_Note_: When running far2l automatically downgrade
if its components are not installed (or system libs are not available):
**GUI****TTY|Xi****TTY|X****TTY**.
To force run only specific backend use in command line:
Expand All @@ -67,25 +69,24 @@ OSC 52 in many terminals is implemented only for the copy mode, and paste from t


## Installing, Running
#### Debian/Ubuntu 23.10+ binaries (with TTY X/Xi backends only)
#### Debian/Ubuntu binaries from the official repositories

```sh
apt-get install far2l
```
* **TTY X/Xi** backends only (Debian / Ubuntu 23.10+)
```sh
apt install far2l
```

Only under Ubuntu Desktop 23.10 with Wayland run as
`far2l --nodetect=xi --ee`
* **GUI** backend (Debian since far2l _2.6.4_)
```sh
apt install far2l-wx
```


<sub>**Debian** has far2 in **sid-unstable** / **13 trixie-testing** / **12 bookworm-backports**; **Ubuntu** from **23.10**.
<sub>**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 </sub>


<sub>Note: now far2l in official repositories Debian/Ubuntu is only TTY|Xi version with extra dependencies of pair X11-libs.
It may be not convenient for some servers.
For servers without X and only terminal/ssh access the plain far2l-TTY version is more suitable
(binaries or portable see in [Community packages & binaries](#community_bins)).</sub>
<sub>_Note_: binaries in official repositories may be very outdated,
actual binaries or portable see in [Community packages & binaries](#community_bins).</sub>

#### OSX/MacOS binaries

Expand Down Expand Up @@ -309,7 +310,7 @@ You can import the project into your favourite IDE like QtCreator, CodeLite, or
* **Visual Studio Code** (required _CMake Tools extension_): open far2l root directory (by default building in subdirectory `_build`; you can change in `.vscode/settings.json`)
<a name="terminals"></a>
### Terminals and SSH clients
## Terminals and SSH clients
Supporting extended far2l keyboard shortcuts and clipboard access
* **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)
Expand All @@ -326,7 +327,7 @@ _Note_: to full transfer extended keyboard shortcuts and the clipboard to/from t
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
## Useful 3rd-party extras
* A collection of macros for far2l: https://github.com/corporateshark/far2l-macros
* Turbo Vision, TUI framework supporting far2l terminal extensions: https://github.com/magiblot/tvision
Expand All @@ -336,14 +337,14 @@ one of the best way to initiate the connection **inside local far2l-GUI**
* **Community wiki & tips** (in Russian; unofficial): https://github.com/akruphi/far2l/wiki
<a name="community_bins"></a>
### Community packages & binaries
## Community packages & binaries
_They are mainteined by enthusiasts and may be not exact with master: sometimes has extra plugins, sometimes has tweak, etc._
* **Portable** (_with TTY X/Xi backend_) | **AppImage** (_with wx-GUI and some extra plugins_): https://github.com/spvkgn/far2l-portable/releases
* **Ubuntu** and **Mint** from PPA with fresh far2l: https://launchpad.net/~far2l-team/+archive/ubuntu/ppa
* **Fedora** and **CentOS**: https://copr.fedorainfracloud.org/coprs/polter/far2l
* **OpenSUSE**, **Fedora**, **Ubuntu**: https://download.opensuse.org/repositories/home:/viklequick/
* **OpenSUSE**, **Fedora**, **Debian**, **Ubuntu**: https://download.opensuse.org/repositories/home:/viklequick/
* **OpenWrt**: https://github.com/spvkgn/far2l-openwrt
* **Termux**: https://github.com/spvkgn/far2l-termux
* **Flatpak**: https://github.com/spvkgn/far2l-flatpak (access only to part of real filesystem via sandbox)
Expand Down
4 changes: 2 additions & 2 deletions WinPort/src/Backend/WX/wxMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ void WinPortPanel::OnKeyDown( wxKeyEvent& event )
// also it didnt cause problems yet
if ( (_key_tracker.Shift() && !event.ShiftDown())
|| ((_key_tracker.LeftControl() || _key_tracker.RightControl()) && !event.ControlDown())) {
if (_key_tracker.CheckForSuddenModifiersUp()) {
if ((!_key_tracker.Alt() || g_wayland) && _key_tracker.CheckForSuddenModifiersUp()) {
_exclusive_hotkeys.Reset();
}
}
Expand Down Expand Up @@ -1438,7 +1438,7 @@ void WinPortPanel::OnKeyUp( wxKeyEvent& event )
#endif
wxConsoleInputShim::Enqueue(&ir, 1);
}
if (_key_tracker.CheckForSuddenModifiersUp()) {
if ((!_key_tracker.Alt() || g_wayland) && _key_tracker.CheckForSuddenModifiersUp()) {
_exclusive_hotkeys.Reset();
}
//event.Skip();
Expand Down
37 changes: 20 additions & 17 deletions WinPort/src/Backend/WinPortMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,22 +235,23 @@ static void ShimSigWinch(int sig)

extern "C" void WinPortHelp()
{
printf("FAR2L backend-specific options:\n");
printf("\t--tty - force using TTY backend only (disable GUI/TTY autodetection)\n");
printf("\t--notty - don't fallback to TTY backend if GUI backend failed\n");
printf("\t--nodetect or --nodetect=[x|xi][f][w][a][k] - don't detect if TTY backend supports X11/Xi input and clipboard interaction extensions and/or disable detect f=FAR2l terminal extensions, w=win32, a=apple iTerm2, k=kovidgoyal's kitty input modes\n");
printf("\t--norgb - don't use true (24-bit) colors\n");
printf("\t--mortal - terminate instead of going to background on getting SIGHUP (default if in Linux TTY)\n");
printf("\t--immortal - go to background instead of terminating on getting SIGHUP (default if not in Linux TTY)\n");
printf("\t--x11 - force GUI backend to run on X11\n");
printf("\t--wayland - force GUI backend to run on Wayland\n");
printf("\t--ee=N - ESC expiration in msec (default is 100, 0 to disable) to avoid need for double ESC presses (valid only in TTY mode without FAR2L extensions)\n");
printf("\t--primary-selection - use PRIMARY selection instead of CLIPBOARD X11 selection (only for GUI backend)\n");
printf("\t--maximize - force maximize window upon launch (only for GUI backend)\n");
printf("\t--nomaximize - dont maximize window upon launch even if its has saved maximized state (only for GUI backend)\n");
printf("\t--clipboard=SCRIPT - use external clipboard handler script that implements get/set text clipboard data via its stdin/stdout\n");
printf(" Backend-specific options also can be set via the FAR2L_ARGS environment variable\n");
printf(" (for example: export FAR2L_ARGS=\"--tty\" to start far2l in tty mode by default)\n");
printf("FAR2L backend-specific options:\n"
"\t--tty - force using TTY backend only (disable GUI/TTY autodetection)\n"
"\t--notty - don't fallback to TTY backend if GUI backend failed\n"
"\t--nodetect or --nodetect=[x|xi][f][w][a][k] - don't detect if TTY backend supports X11/Xi input and clipboard interaction extensions and/or disable detect f=FAR2l terminal extensions, w=win32, a=apple iTerm2, k=kovidgoyal's kitty input modes\n"
"\t--norgb - don't use true (24-bit) colors\n"
"\t--mortal - terminate instead of going to background on getting SIGHUP (default if in Linux TTY)\n"
"\t--immortal - go to background instead of terminating on getting SIGHUP (default if not in Linux TTY)\n"
"\t--x11 - force GUI backend to run on X11\n"
"\t--wayland - force GUI backend to run on Wayland\n"
"\t--ee=N - ESC expiration in msec (default is 100, 0 to disable) to avoid need for double ESC presses (valid only in TTY mode without FAR2L extensions)\n"
"\t--primary-selection - use PRIMARY selection instead of CLIPBOARD X11 selection (only for GUI backend)\n"
"\t--maximize - force maximize window upon launch (only for GUI backend)\n"
"\t--nomaximize - dont maximize window upon launch even if its has saved maximized state (only for GUI backend)\n"
"\t--clipboard=SCRIPT - use external clipboard handler script that implements get/set text clipboard data via its stdin/stdout\n"
"\n"
"All options (except -h and -u) also can be set via the FAR2L_ARGS environment variable\n"
" (for example: export FAR2L_ARGS=\"--tty\" to start far2l in tty mode by default)\n");
}

struct ArgOptions
Expand Down Expand Up @@ -385,7 +386,7 @@ extern "C" int WinPortMain(const char *full_exe_path, int argc, char **argv, int
}
}

for (int i = 0; i < argc; ++i) {
for (int i = 1; i < argc; ++i) { // from 1 = skip self name here
arg_opts.ParseArg(argv[i], false);
}

Expand All @@ -407,6 +408,8 @@ extern "C" int WinPortMain(const char *full_exe_path, int argc, char **argv, int
}
}

if (argc>0)
arg_opts.filtered_argv.emplace(arg_opts.filtered_argv.begin(), argv[0]); // self name should be always first
if (!arg_opts.filtered_argv.empty()) {
argv = &arg_opts.filtered_argv[0];
}
Expand Down
2 changes: 2 additions & 0 deletions colorer/configs/base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- [smarty] fixed the work of smarty templates
- [markdown] amend emphasis with underscores
- [markdown] fix trailing spaces in em and strong
- [smarty] fixed working with nested brackets
- [smarty] literal block - text only

### Changed
- Simplified catalog.xml.
Expand Down
11 changes: 9 additions & 2 deletions colorer/configs/base/hrc/inet/smarty.hrc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
</scheme>

<scheme name="Script">
<block start="/\s*\b((block|capture|function|for\b|literal|nocache|setfilter|strip|while))\b/" end="/(\/\Y2)/"
<block start="/\s*\b((block|capture|function|for\b|nocache|setfilter|strip|while))\b/" end="/(\/\Y2)/"
region01="PairStart" region10="PairEnd"
region02="def:Keyword" region11="def:Keyword"
scheme="Script" priority="low"
Expand Down Expand Up @@ -281,6 +281,13 @@

<scheme name="Insertion">
<!--<inherit scheme="smartyEscape" />-->
<block start="/(\{)((literal))(\})/" end="/(\{)((\/literal))(\})/"
region01="OpenTag" region11="OpenTag"
region02="def:PairStart" region12="def:PairEnd"
region04="OpenTag" region14="OpenTag"
region03="def:Keyword" region13="def:Keyword"
scheme="asp:html" priority="normal" content-priority="normal"
/>
<inherit scheme="smartyComment" />
<inherit scheme="smartyPhpInsertion"/>

Expand All @@ -292,7 +299,7 @@
</scheme>

<scheme name="InverseInsertion">
<block start="/(\})/" end="/(\{)/" scheme="html"
<block start="/(\})/" end="/(\{)\M\S/" scheme="html"
priority="low" region="Text" inner-region="yes"
region00="Insertion" region10="Insertion"
region01="OpenTag" region11="OpenTag"
Expand Down
11 changes: 8 additions & 3 deletions colorer/src/Colorer-library/CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
Colorer team past and present
"Colorer" team in the present
~~~~~~~~~~~~~~~~~~~~~~~~~~
Igor Ruskih
Aleksey Dobrunov

"Colorer" team in the past
~~~~~~~~~~~~~~~~~~~~~~~~~~
Igor Ruskih
Eugene Efremov
Anatoly Techtonik

Expand All @@ -11,4 +14,6 @@ If you think that you are missing from
this list, let us know.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2useven10
Max Galkin
Max Galkin
platima
elfmz
7 changes: 3 additions & 4 deletions colorer/src/Colorer-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You may build library on linux using standard package, without vcpkg.
#### Ubuntu example

```bash
sudo apt install libicu-dev libxerces-c-dev zlib1g-dev libminizip-dev libxml2-dev
sudo apt install libicu-dev zlib1g-dev libminizip-dev libxml2-dev
git clone https://github.com/colorer/Colorer-library.git
cd Colorer-library
mkdir _build
Expand All @@ -57,7 +57,7 @@ cmake --build _build -j$(nproc --all)
#### CentOS Example

```bash
sudo yum install libicu-devel xerces-c-devel zlib-devel minizip1.2-devel
sudo yum install libicu-devel zlib-devel minizip1.2-devel
git clone https://github.com/colorer/Colorer-library.git
cd Colorer-library
mkdir _build
Expand All @@ -67,7 +67,7 @@ cmake --build _build -j$(nproc --all)
### MacOS

```bash
brew install xerces-c icu4c minizip ninja libxml2
brew install icu4c minizip ninja libxml2
git clone https://github.com/colorer/Colorer-library.git
cd Colorer-library
mkdir _build
Expand All @@ -89,7 +89,6 @@ This options available for build
* `COLORER_USE_ZIPINPUTSOURCE` - Enable the ability to work with schemes in zip archives. Default 'ON'.
* `COLORER_USE_DEEPTRACE` - Use trace logging. Default 'OFF'.
* `COLORER_USE_ICU_STRINGS` - Use ICU library for strings. Default 'ON'.
* `COLORER_USE_LIBXML` - Use LibXml2 library for parse xml, instead XercesC. Default 'OFF'.

Links
========================
Expand Down
54 changes: 17 additions & 37 deletions colorer/src/Colorer-library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,44 +87,30 @@ set(SRC_COLORER
colorer/viewer/TextConsoleViewer.h
colorer/viewer/TextLinesStore.cpp
colorer/viewer/TextLinesStore.h
colorer/xml/XMLNode.cpp
colorer/xml/XMLNode.h
colorer/xml/XmlInputSource.cpp
colorer/xml/XmlInputSource.h
colorer/xml/XmlReader.cpp
colorer/xml/XmlReader.h
)

if(COLORER_USE_LIBXML)
set(COLORER_FEATURE_LIBXML 1)
set(SRC_COLORER_XML
colorer/xml/libxml2/LibXmlReader.cpp
colorer/xml/libxml2/LibXmlReader.h
colorer/xml/libxml2/LibXmlInputSource.h
)
else()
set(SRC_COLORER_XML
colorer/xml/xercesc/BaseEntityResolver.cpp
colorer/xml/xercesc/BaseEntityResolver.h
colorer/xml/xercesc/LocalFileXmlInputSource.cpp
colorer/xml/xercesc/LocalFileXmlInputSource.h
colorer/xml/xercesc/SharedXmlInputSource.cpp
colorer/xml/xercesc/SharedXmlInputSource.h
colorer/xml/xercesc/XercesXmlInputSource.cpp
colorer/xml/xercesc/XercesXmlInputSource.h
colorer/xml/xercesc/XmlParserErrorHandler.cpp
colorer/xml/xercesc/XmlParserErrorHandler.h
colorer/xml/xercesc/XercesXmlReader.h
colorer/xml/xercesc/XercesXmlReader.cpp
)
endif()

if(COLORER_USE_ZIPINPUTSOURCE AND NOT(COLORER_USE_LIBXML))
set(SRC_COLORER_XML
colorer/xml/libxml2/LibXmlReader.cpp
colorer/xml/libxml2/LibXmlReader.h
colorer/xml/libxml2/LibXmlInputSource.h
colorer/xml/libxml2/LibXmlInputSource.cpp
)


if(COLORER_USE_ZIPINPUTSOURCE)
set(COLORER_FEATURE_ZIPINPUTSOURCE 1)
set(SRC_COLORER_ZIP
colorer/xml/xercesc/MemoryFile.cpp
colorer/xml/xercesc/MemoryFile.h
colorer/xml/xercesc/ZipXmlInputSource.cpp
colorer/xml/xercesc/ZipXmlInputSource.h
colorer/xml/libxml2/SharedXmlInputSource.cpp
colorer/xml/libxml2/SharedXmlInputSource.h
colorer/zip/MemoryFile.cpp
colorer/zip/MemoryFile.h
)
endif()

Expand Down Expand Up @@ -246,15 +232,9 @@ set_target_properties(colorer_lib PROPERTIES
CXX_EXTENSIONS NO
)

if(COLORER_USE_LIBXML)
target_link_libraries(colorer_lib
PUBLIC LibXml2::LibXml2
)
else()
target_link_libraries(colorer_lib
PUBLIC XercesC::XercesC
)
endif()
target_link_libraries(colorer_lib
PUBLIC LibXml2::LibXml2
)

if(COLORER_USE_ICU_STRINGS)
target_link_libraries(colorer_lib
Expand Down
Loading

0 comments on commit bf63847

Please sign in to comment.