Coder Social home page Coder Social logo

shmuz / far2m Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elfmz/far2l

23.0 7.0 1.0 94.35 MB

Linux port of FAR2 with FAR3 macro system and extended plugins' API

License: GNU General Public License v2.0

CSS 0.16% Makefile 0.02% C++ 42.06% C 46.13% CMake 0.65% Perl 0.02% M4 7.04% Awk 0.02% Shell 0.25% Ruby 0.01% Python 0.72% AppleScript 0.01% Objective-C++ 0.04% Lua 2.83% VBScript 0.01% templ 0.06%

far2m's Introduction

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

  • FAR for Windows and some of its plugins
  • WINE
  • ANSICON
  • Portable UnRAR
  • 7z ANSI-C Decoder
  • utf-cpp by ww898

Contributing, Hacking

Required dependencies

  • gawk
  • m4
  • 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)
  • libx11-dev (optional - needed for X11 extension that provides better UX for TTY backend wherever X11 is available)
  • libxi-dev (optional - needed for X11/Xi extension that provides best UX for TTY backend wherever X11 Xi extension is available)
  • libxerces-c-dev (optional - needed for Colorer plugin, not needed with -DCOLORER=no)
  • libuchardet-dev
  • libssh-dev (optional - needed for NetRocks/SFTP)
  • libssl-dev (optional - needed for NetRocks/FTPS)
  • libsmbclient-dev (optional - needed for NetRocks/SMB)
  • libnfs-dev (optional - needed for NetRocks/NFS)
  • libneon27-dev (or later, optional - needed for NetRocks/WebDAV)
  • libarchive-dev (optional - needed for better archives support in multiarc)
  • libpcre3-dev (or in older distributives - libpcre2-dev) (needed for custom archives support in multiarc)
  • libluajit-5.1-dev
  • uuid-dev
  • cmake ( >= 3.2.2 )
  • pkg-config
  • g++
  • git (needed for downloading source code)

Or simply on Debian/Ubuntu:

apt-get install gawk m4 libwxgtk3.0-gtk3-dev libx11-dev libxi-dev libpcre3-dev libxerces-c-dev libspdlog-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 libpcre2-dev and libwxgtk3.0-dev instead of libpcre3-dev and libwxgtk3.0-gtk3-dev

Clone and Build

  • Clone current master git clone https://github.com/shmuz/far2m
  • Prepare build directory:
mkdir -p far2m/_build
cd far2m/_build
  • Build: with make:
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
  • If above commands finished without errors - you may also install far2m, with make: sudo make install or with ninja: sudo ninja install

  • Also its possible to create far2m_2.X.X_ARCH.deb or ...tar.gz packages in _build directory by running cpack command

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

To build with Python plugin: add argument -DPYTHON=yes

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:

  • int Execute(const wchar_t *CmdStr, unsigned int ExecFlags); ...where ExecFlags - combination of values of EXECUTEFLAGS. Executes given command line, if EF_HIDEOUT and EF_NOWAIT are not specified then command will be executed on far2l virtual terminal.

  • int ExecuteLibrary(const wchar_t *Library, const wchar_t *Symbol, const wchar_t *CmdStr, unsigned int ExecFlags) Executes given shared library symbol in separate process (process creation behaviour is the same as for Execute). symbol function must be defined as: int 'Symbol'(int argc, char *argv[])

  • void DisplayNotification(const wchar_t *action, const wchar_t *object); Shows (depending on settings - always or if far2l in background) system shell-wide notification with given title and text.

  • int DispatchInterThreadCalls(); far2l supports calling APIs from different threads by marshalling API calls from non-main threads into main one and dispatching them on main thread at certain known-safe points inside of dialog processing loops. DispatchInterThreadCalls() allows plugin to explicitely dispatch such calls and plugin must use it periodically in case it blocks main thread with some non-UI activity that may wait for other threads.

  • void BackgroundTask(const wchar_t *Info, BOOL Started); If plugin implements tasks running in background it may invoke this function to indicate about pending task in left-top corner. Info is a short description of task or just its owner and must be same string when invoked with Started TRUE or FALSE.

Added following commands into FILE_CONTROL_COMMANDS:

  • FCTL_GETPANELPLUGINHANDLE Can be used to interract with plugin that renders other panel. hPlugin can be set to PANEL_ACTIVE or PANEL_PASSIVE. Param1 ignored. Param2 points to value of type HANDLE, call sets that value to handle of plugin that renders specified panel or INVALID_HANDLE_VALUE.

Added following plugin-exported functions:

  • int MayExitFARW(); far2l asks plugin if it can exit now. If plugin has some background tasks pending it may block exiting of far2l, however it highly recommended to give user choice using UI prompt.

Added following dialog messages:

  • DM_GETCOLOR - retrieves get current color attributes of selected dialog item
  • DM_SETCOLOR - changes current color attributes of selected dialog item

Known issues:

  • Only valid translations are English, Russian and Ukrainian, all other languages require deep correction.
  • Characters that occupy more than single cell or diacritic-like characters are rendered buggy, that means Chinese and Japanese texts are hardly readable in some cases.

far2m's People

Contributors

akozlins avatar alter-1 avatar anteo avatar bolddwarf avatar corporateshark avatar cycleg avatar dstogov avatar dvlom avatar elfmz avatar iliakonnov avatar invy avatar ivanshatsky avatar j2969719 avatar lieff avatar m32 avatar michaellukashov avatar mikemirzayanov avatar rampitec avatar randolf avatar russiandesman avatar shmuz avatar singalen avatar svost avatar sxored avatar techtonik avatar thinkingerrol avatar unxed avatar vasilievip avatar yurikoles avatar zoleg73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

domin50043

far2m's Issues

Поведение Quick Search при нажатии Alt (Alt-Tab)

Первое - при нажатии Alt-Tab для перехода в другое окно, в фаре выскакивает и остается висеть окошко "Quick Search" (если вернуться в фар и снова нажать Alt-Tab, окошко пропадает, т.е., я так понимаю, Quick Search срабатывает на нажатие Alt - логичнее было бы, если б срабатывал на отпускание)

Второе - если в текущей директории есть файл, начинающийся с "Б" (именно с большой "б"), то после нажатия Alt в выскакивающее "Quick Search" вставляется символ "<", и курсор перескакивает на этот файл на "Б":

image

Сессионные закладки: улучшить плагиновое АПИ

Не знаю будет ли это вам интересно, но тем не менее напомню, о том, что некоторые вещи можно реализовать лучше чем в Far 3.

https://bugs.farmanager.com/view.php?id=2750
https://bugs.farmanager.com/view.php?id=3771

Кроме того, тема связана с #10: некоторые плагины вынуждены использовать EE_CHANGE для "ручного" отслеживания своих закладок, поскольку отсутствует нормальное апи.

DN_EDITCHANGE приходит лишний раз и с ложной информацией

See https://bugs.farmanager.com/view.php?id=1722
Description:
[ Far 2.0.1807, Far 3.0.1897 ]
Допустим диалог состоит из единственного элемента DI_EDIT, больше элементов нет. При появлении диалога сразу нажмём на клавишу, допустим, W. Приходят два события DN_EDITCHANGE вместо одного, причём в первом из них PtrData указывает на пустую строку.

Последующие нажатия на клавиши, вызывающие изменения текста, отрабатываются правильно, лишние ложные события не приходят.

EF_DELETEONCLOSE causes Far hanging

Повторное (не первое) применение флага EF_DELETEONCLOSE в функции editor.Editor приводит к зависанию Фара с потреблением процессора 50-80%.

  • EF_DELETEONLYFILEONCLOSE к этому эффекту не приводит
  • VF_DELETEONCLOSE в функции viewer.Viewer к этому эффекту не приводит.

Копирование в общий буфер

Скопированное в буфер, например из Firefox, можно вставить, а вот наоборот к сожалению нет и скопированное в буфер остается доступным только в пределах FAR. Хотелось бы полноценного взаимодействия с буфером.

N.B. Использую GNOME под Wayland

Context search has incorrect symbol

Pre-Condition:

  1. System has Russian & English installed languages
  2. Currently set an ENG mode
  3. Opened any folder with existed files

Test Steps:

  1. Press ALT_LEFT for activate context search in file panel
  2. Press tmp symbols

Actual Result:

  1. first russian symbol is typed as showed on the screen

Expected Result:

  1. All symbols SHOULD be according to actual selected language

image

проблема с прорисовкой результата поиска файлов

проблема с прорисовкой результата поиска файлов
[рассинхронизация потоков поиска и отображения информации?]

как минимум после запроса на повышение прав
проверено на FAR2M 2.6.0-2024-03-07-3eaf5b3-beta Linux x86_64

авторизовались на Linux под ограниченным юзером
запустили Far2m
перешли в корень
зашли в \boot\

запустили поиск файлов *

какие то файлы появляются но попутно просит в фоне задать пароль для повышения прав

вводим в результате информация найденных файлов исчезает (но она есть там)

если стрелочки вверх вниз покрутить появляются найденные данные

не работает буфер обмена в последующих запущенных экземплярах фара

Ubuntu 23.04, SSH

В последующих запущенных экземплярах фара
не работает буфер обмена
те ctrlc/shiftins/ctrlv...

при попытке активации как бы подвисает ввод/вывод
нужно жать ESC чтобы отвисло

Far2L норм работает
может надо какой то код утянуть оттуда?

ps. FAR2L может ещё запросить в другом экзепмляре FAR2L текст диалог:
Please choose how this terminal application may use clipboard

пока не понял когда это может возникнуть, в FAR2M есть обработка этого?

func goto: improvement

Добавить "понимание" командой goto: путей содержащих обратные слеши

например есть файл с пробелом "custom.ini.man 2.txt"
CtrF на в FAR'e (linux) скидывает в ком строку путь в таком виде:
/home/admin/Dindikov-Home/Import/f/Plugins/multiarc/plug/custom.ini.man\ 2.txt

сделали CtrlC (те скопировали в буфер обмена)
на второй панели
goto: +Shift Ins

goto: /home/admin/Dindikov-Home/Import/f/Plugins/multiarc/plug/custom.ini.man\ 2.txt
сейчас произойдёт переход в каталог /home/admin/Dindikov-Home/Import/f/Plugins/multiarc/plug/
без позиционирования на файл

а если пути были с пробелами, то никуда переход не происходит вообще
пример пути:
/home/admin/Dindikov-Home/Import/f/Plugins/1\ 2\ 3/custom.ini.man.txt

Неверная работа панели команд с Alt и мышью.

Если зажать клавишу Alt и нажать мышью на первую или вторую команду в панели команд внизу окна, то вместо открытия окна перехода открываются либо справка, либо главное меню.
В тоже время если нажать на третью команду "Просмотр", открывается окно просмотра текущего файла, т.е. команда срабатывает как и должна.

Executing Keys("Enter") with non-empty command line

Executing Keys("Enter") with non-empty command line causes painting panels on the "desktop".
Example:

  1. Type git diff > 123.diff in the command line
  2. Call "Post Macro" dialog
  3. Type there Keys("Enter") and press Enter

The command executes correctly but CtrlO reveals file panels drawn on the "desktop".

win.WriteConsole \n processing

panel.GetUserScreen()
win.WriteConsole("Some text\n")
panel.SetUserScreen()

This script results in: image, i.e there's no transition to the next line while in Far3 (Windows) win.WriteConsole can output multi-line text.

far:config, far:about

Добавить функционал
far:config
far:about

из кодовой базы Far2l

Window title does not change immediately after changes are made in an "Interface settings" dialog window

Что в целом в общем-то и ожидаемо.
Это я был автором коммита 60e93e7
После закрытия диалогового окна и срабатывания деструктора ~ConsoleTitle() восстанавливается старое значение window title без учёта последних изменений.
Но что странно, в far2l видно, как сначала восстанавливается старое значение, а потом сразу меняется на новое.
А в far2m надо, чтобы сработало изменение window title, например после смены текущего каталога.
Такое чувство, что в far2l SetFarTitle дёргается кем-то ещё раз, а в far2m этого уже не происходит.
У вас есть идеи, из-за чего это происходит в far2l, и как это можно поправить в far2m?

Suggestion: New custom name of fork

сейчас при запуске FAR2L
выдаётся:
FAR2L, version 2.4.0-d8649393-beta Linux x86_64
Copyright (C) 1996-2000 Eugene Roshal, Copyright (C) 2000-2016 Far Group, Copyright (C) 2016-2023 Far People

рано или поздно надо как то показывать что это мод

например FAR2L-Lua хотя бы...

Поломалась поддержка создания rar архивов

В последнее время заметил при сборке сообщение rar archives support disabled due to UNRAR=., после чего из MultiArc пропала возможность создавать rar архивы и его нет в списке архивов в конфигураторе плагина. Rar и unrar конечно есть. Собрал для теста свежий far2l-elfmz и там такой проблемы нет и rar архивы создаються.

Переключение кодировок по F8

Заметил что F8 в редакторе (и в родителе тоже) переключает между кодировками 1252/437, а не 1251/866 как в Windows версии FAR. Возможно ли сделать поведение аналогично Windows версии или так сделано специально?

COPY/PAST is not working for applications supported XCLIP

Actually FAR2M uses TTY Clipboard and COPY/PAST working fine in/from console and other many applications, but it's not working for some other applications for example Telegram

  1. FAR2M <-> Telegram = NOK
  2. TELEGRAM <-> NEDIT <-> FAR2M = OK

Is it possible to investigate how it can be fixed?

Reference: elfmz#810

Bug "pandoca"

  1. The bug was first noticed around 2023-09-01
  2. The bug is already present in far2l version from 2021-07-24
  3. Current far2l also has this bug

image

Ошибка сборки в Arch Linux [GCC 13.1.1]

Не выходит собрать, хотя даже попробовал пересобрать билд который стоит. Я думаю это по причине недавнего обновления на GCC 13.1.1. Вначале выдало такое:

/home/vlk/Downloads/far2m/WinPort/src/APIConsole.cpp: In function ‘COMP_CHAR WINPORT_CompositeCharRegister(const WCHAR*)’:
/home/vlk/Downloads/far2m/WinPort/src/APIConsole.cpp:398:44: error: ‘logic_error’ is not a member of ‘std’
  398 |                                 throw std::logic_error("wcsdup failed");
      |                                            ^~~~~~~~~~~
/home/vlk/Downloads/far2m/WinPort/src/APIConsole.cpp:7:1: note: ‘std::logic_error’ is defined in header ‘<stdexcept>’; did you forget to ‘#include <stdexcept>’?
    6 | #include "Backend.h"
  +++ |+#include <stdexcept>
    7 | 
[9/718] Building CXX object WinPort/CMakeFiles/WinPort.dir/src/APIFiles.cpp.o
ninja: build stopped: subcommand failed.

А когда я добавил include как мне и советует компилятор получил такое:

[6/710] Building CXX object WinPort/CMakeFiles/WinPort.dir/src/APIRegistry.cpp.o
/home/vlk/Downloads/far2m/WinPort/src/APIRegistry.cpp: In function ‘LONG WINPORT_RegSetValueEx(HKEY, LPCWSTR, DWORD, DWORD, const BYTE*, DWORD)’:
/home/vlk/Downloads/far2m/WinPort/src/APIRegistry.cpp:738:25: warning: array subscript 0 is outside array bounds of ‘volatile int [0]’ [-Warray-bounds=]
  738 |                         *(volatile int*)100 = 200;
      |                         ^~~~~~~~~~~~~~~~~~~
cc1plus: note: source object is likely at address zero
[9/710] Building CXX object WinPort/CMakeFiles/WinPort.dir/src/CustomPanic.cpp.o
FAILED: WinPort/CMakeFiles/WinPort.dir/src/CustomPanic.cpp.o 
/usr/bin/c++  -I/home/vlk/Downloads/far2m/utils/include -I/home/vlk/Downloads/far2m/WinPort/. -I/home/vlk/Downloads/far2m/WinPort/src -I/home/vlk/Downloads/far2m/WinPort/src/Backend -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-sections -fdata-sections -Wl,--gc-sections -DWINPORT_REGISTRY  -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -O2 -std=c++11 -fvisibility=hidden -MD -MT WinPort/CMakeFiles/WinPort.dir/src/CustomPanic.cpp.o -MF WinPort/CMakeFiles/WinPort.dir/src/CustomPanic.cpp.o.d -o WinPort/CMakeFiles/WinPort.dir/src/CustomPanic.cpp.o -c /home/vlk/Downloads/far2m/WinPort/src/CustomPanic.cpp
In file included from /home/vlk/Downloads/far2m/utils/include/utils.h:7,
                 from /home/vlk/Downloads/far2m/WinPort/src/CustomPanic.cpp:1:
/home/vlk/Downloads/far2m/utils/include/BitTwiddle.hpp: In function ‘V RevBytes(const V&)’:
/home/vlk/Downloads/far2m/utils/include/BitTwiddle.hpp:38:54: error: ‘uint64_t’ was not declared in this scope
   38 |                 case 8: return (V)__builtin_bswap64((uint64_t)value);
      |                                                      ^~~~~~~~
/home/vlk/Downloads/far2m/utils/include/BitTwiddle.hpp:1:1: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
  +++ |+#include <cstdint>
    1 | #pragma once
/home/vlk/Downloads/far2m/utils/include/BitTwiddle.hpp:39:54: error: ‘uint32_t’ was not declared in this scope
   39 |                 case 4: return (V)__builtin_bswap32((uint32_t)value);
      |                                                      ^~~~~~~~
/home/vlk/Downloads/far2m/utils/include/BitTwiddle.hpp:39:54: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/vlk/Downloads/far2m/utils/include/BitTwiddle.hpp:40:54: error: ‘uint16_t’ was not declared in this scope
   40 |                 case 2: return (V)__builtin_bswap16((uint16_t)value);
      |                                                      ^~~~~~~~
/home/vlk/Downloads/far2m/utils/include/BitTwiddle.hpp:40:54: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
[13/710] Building CXX object WinPort/CMakeFiles/WinPort.dir/src/PathHelpers.cpp.o
ninja: build stopped: subcommand failed.

cmake version and TRANSFORM subcommand

Hello!

В требованиях указана версия cmake ( >= 3.2.2 ).
В Ubuntu 16.04 cmake version 3.5.1.
При компиляции возникает ошибка:
CMake Error at luamacro/CMakeLists.txt:27 (list): list does not recognize sub-command TRANSFORM
Причина - для TRANSFORM требуется cmake не ниже 3.12 https://cmake.org/cmake/help/latest/command/list.html#transform.
Все остальные бинарники собираются в Ubuntu 16.04.
Можно ли в luamacro обойтись без TRANSFORM?

И второй вопрос, так же связанный с компиляцией в Ubuntu 16.04.
В CMakeLists.txt прописана зависимость от luajit-2.1. Можно ли использовать luajit-2.0, или эта версия не совместима с luafar?

In required dependencies cmake version specified >= 3.2.2.
When I compile far2l with lua support in Ubuntu 16.04 (cmake version 3.5.1), I get an error:
CMake Error at luamacro/CMakeLists.txt:27 (list): list does not recognize sub-command TRANSFORM
Because TRANSFORM is new in cmake since 3.12 https://cmake.org/cmake/help/latest/command/list.html#transform.
All other binaries build fine in Ubuntu 16.04.
Is it possible not to use "TRANSFORM" in luamacro?

And one more question, may I use luajit-2.0 instead of luajit-2.1 with luafar?

Error "Command not found"

"Command not found".

  • The error appeared in the last 1-2 days.
  • The sequence to reproduce it is currently unknown.

image

far2m terminates itself unexpectedly after start

version info

$ git log -3
commit ed4b214927ab546ddfc41a88ded3c69377731bba (HEAD -> master, origin/master, origin/HEAD)
Author: Shmuel Zeigerman <[email protected]>
Date:   Sun Sep 17 12:22:07 2023 +0300

    A special build with logging enabled (for PPA debugging)

commit 3bda361d20db0b8191e147aa3170ad3fcecd78cc
Author: Shmuel Zeigerman <[email protected]>
Date:   Sat Sep 16 16:27:44 2023 +0300

    LuaFAR API: export.ProcessEvent -> export.ProcessPanelEvent

commit acb37853cb55d2505377a327a26a8c8e536b0c74
Author: Shmuel Zeigerman <[email protected]>
Date:   Sat Sep 16 15:22:50 2023 +0300

    Refactoring

far2m built successfully

there is no error text after start in terminal

$ export FAR_STD=/tmp/farstd.log
$ export NETROCKS_VERBOSE=9

$ ./far2m --tty

$ tail -n 6 /tmp/farstd.log

FSNotify: watching 1 entries for '/home/user'
FSNotify: watching 1 entries for '/home/user'
CommandLine::ShowBackground: done
PANIC: unprotected error in call to Lua API (bad light userdata pointer)
PipeIPCError: PipeIPCRecver: read (11)
TTYX: PipeIPCRecver: read (11)

Failed build on FreeBSD 13.2

Сборка far2m под FreeBSD 13.2 с ключами cmake по умолчанию завершается с ошибкой:

[265/774] Building C object luafar/CMakeFiles/luafar.dir/src/mytimer.c.o
FAILED: luafar/CMakeFiles/luafar.dir/src/mytimer.c.o 
/usr/bin/cc -DFAR_DONT_USE_INTERNALS -DWINPORT_DIRECT -Dluafar_EXPORTS -I/home/alexax/src/far2l-shmuz-2/utils/include -I/usr/local/include/luajit-2.1 -I/home/alexax/src/far2l-shmuz-2/far/far2sdk -I/home/alexax/src/far2l-shmuz-2/WinPort -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-sections -fdata-sections -DWINPORT_REGISTRY  -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -O2 -std=gnu11 -fPIC -fvisibility=hidden -MD -MT luafar/CMakeFiles/luafar.dir/src/mytimer.c.o -MF luafar/CMakeFiles/luafar.dir/src/mytimer.c.o.d -o luafar/CMakeFiles/luafar.dir/src/mytimer.c.o -c /home/alexax/src/far2l-shmuz-2/luafar/src/mytimer.c
/home/alexax/src/far2l-shmuz-2/luafar/src/mytimer.c:5:10: fatal error: 'sys/timerfd.h' file not found
#include <sys/timerfd.h>
         ^~~~~~~~~~~~~~~
1 error generated.
[267/774] Building C object luafar/CMakeFiles/luafar.dir/src/ustring.c.o
FAILED: luafar/CMakeFiles/luafar.dir/src/ustring.c.o 
/usr/bin/cc -DFAR_DONT_USE_INTERNALS -DWINPORT_DIRECT -Dluafar_EXPORTS -I/home/alexax/src/far2l-shmuz-2/utils/include -I/usr/local/include/luajit-2.1 -I/home/alexax/src/far2l-shmuz-2/far/far2sdk -I/home/alexax/src/far2l-shmuz-2/WinPort -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-sections -fdata-sections -DWINPORT_REGISTRY  -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -O2 -std=gnu11 -fPIC -fvisibility=hidden -MD -MT luafar/CMakeFiles/luafar.dir/src/ustring.c.o -MF luafar/CMakeFiles/luafar.dir/src/ustring.c.o.d -o luafar/CMakeFiles/luafar.dir/src/ustring.c.o -c /home/alexax/src/far2l-shmuz-2/luafar/src/ustring.c
/home/alexax/src/far2l-shmuz-2/luafar/src/ustring.c:1:10: fatal error: 'uuid/uuid.h' file not found
#include <uuid/uuid.h>
         ^~~~~~~~~~~~~
1 error generated.

Если отключть сборку плагина lua (-DUSELUA=NO), то процесс завершается с ошибкой:

[388/502] Building CXX object netcfg/CMakeFiles/netcfg.dir/src/netif/netif.cpp.o
FAILED: netcfg/CMakeFiles/netcfg.dir/src/netif/netif.cpp.o 
/usr/bin/c++ -DFAR_DONT_USE_INTERNALS -DUNICODE -DUSEUCD=OFF -DWINPORT_DIRECT -Dnetcfg_EXPORTS -I/home/alexax/src/far2l-shmuz-2/utils/include -I/home/alexax/src/far2l-shmuz-2/netcfg/src -I/home/alexax/src/far2l-shmuz-2/far/far2sdk -I/home/alexax/src/far2l-shmuz-2/WinPort -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-sections -fdata-sections -DWINPORT_REGISTRY -Wall  -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -O2 -std=c++17 -fPIC -fvisibility=hidden -MD -MT netcfg/CMakeFiles/netcfg.dir/src/netif/netif.cpp.o -MF netcfg/CMakeFiles/netcfg.dir/src/netif/netif.cpp.o.d -o netcfg/CMakeFiles/netcfg.dir/src/netif/netif.cpp.o -c /home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp
In file included from /home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:6:
In file included from /home/alexax/src/far2l-shmuz-2/netcfg/src/common/netutils.h:15:
/usr/include/net/route.h:64:18: error: field has incomplete type 'struct sockaddr'
        struct  sockaddr ro_dst;
                         ^
/usr/include/net/route.h:64:9: note: forward declaration of 'sockaddr'
        struct  sockaddr ro_dst;
                ^
In file included from /home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:6:
In file included from /home/alexax/src/far2l-shmuz-2/netcfg/src/common/netutils.h:16:
/usr/include/net/if_arp.h:90:18: error: field has incomplete type 'struct sockaddr'
        struct  sockaddr arp_pa;                /* protocol address */
                         ^
/usr/include/net/route.h:64:9: note: forward declaration of 'sockaddr'
        struct  sockaddr ro_dst;
                ^
In file included from /home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:6:
In file included from /home/alexax/src/far2l-shmuz-2/netcfg/src/common/netutils.h:16:
/usr/include/net/if_arp.h:91:18: error: field has incomplete type 'struct sockaddr'
        struct  sockaddr arp_ha;                /* hardware address */
                         ^
/usr/include/net/route.h:64:9: note: forward declaration of 'sockaddr'
        struct  sockaddr ro_dst;
                ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:605:41: error: use of undeclared identifier 'NET_RT_IFLIST2'
        int mib[6] = {CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST2, 0};
                                               ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:629:25: error: use of undeclared identifier 'RTM_IFINFO2'
                        if( ifm->ifm_type == RTM_IFINFO2 ) {
                                             ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:631:59: error: arithmetic on a pointer to an incomplete type 'struct if_msghdr2'
                                struct sockaddr_dl *sdl = (struct sockaddr_dl *)(if2m + 1);
                                                                                 ~~~~ ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:634:22: error: member access into incomplete type 'struct if_msghdr2'
                                        ifa_flags = if2m->ifm_flags;
                                                        ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:635:25: error: member access into incomplete type 'struct if_msghdr2'
                                        send_packets = if2m->ifm_data.ifi_opackets;
                                                           ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:636:25: error: member access into incomplete type 'struct if_msghdr2'
                                        recv_packets = if2m->ifm_data.ifi_ipackets;
                                                           ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:637:23: error: member access into incomplete type 'struct if_msghdr2'
                                        send_bytes = if2m->ifm_data.ifi_obytes;
                                                         ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:638:23: error: member access into incomplete type 'struct if_msghdr2'
                                        recv_bytes = if2m->ifm_data.ifi_ibytes;
                                                         ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:639:23: error: member access into incomplete type 'struct if_msghdr2'
                                        send_errors =if2m->ifm_data.ifi_oerrors;
                                                         ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:640:24: error: member access into incomplete type 'struct if_msghdr2'
                                        recv_errors = if2m->ifm_data.ifi_ierrors;
                                                          ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:641:23: error: member access into incomplete type 'struct if_msghdr2'
                                        collisions = if2m->ifm_data.ifi_collisions;
                                                         ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:642:22: error: member access into incomplete type 'struct if_msghdr2'
                                        multicast = if2m->ifm_data.ifi_imcasts + if2m->ifm_data.ifi_omcasts;
                                                        ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:642:51: error: member access into incomplete type 'struct if_msghdr2'
                                        multicast = if2m->ifm_data.ifi_imcasts + if2m->ifm_data.ifi_omcasts;
                                                                                     ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:643:16: error: member access into incomplete type 'struct if_msghdr2'
                                        mtu = if2m->ifm_data.ifi_mtu;
                                                  ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:630:12: note: forward declaration of 'if_msghdr2'
                                struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
                                       ^
/home/alexax/src/far2l-shmuz-2/netcfg/src/netif/netif.cpp:664:56: error: use of undeclared identifier 'IFF_NOTRAILERS'
bool NetInterface::IsNotrailers() { return ifa_flags & IFF_NOTRAILERS; };
                                                       ^
18 errors generated.
ninja: build stopped: subcommand failed.

Сменить иконку

Предлагаю заменить иконку приложения, хотя бы по цвету, сделать ее серой к примеру.
Я иногда использую far2m и far2l параллельно, и хотелось бы, чтобы на панели задач по иконке сразу было бы видно, кто есть кто.

Плагин для просмотра изображений

Надеюсь я не обнаглел до предела :) Планируете ли вы написать хоть самый простенький плагин для просмотра изображений чтобы хотя-бы можно было листать их посредством PgUp/PgDn и делать пометку на панели кнопкой Ins ?

Failed build on Dragonfly BSD

Компиляция far2m на Dragonfly BSD 6.4 завершается с ошибкой:

[250/739] Building CXX object far/CMakeFiles/far2m.dir/src/cache.cpp.o
FAILED: far/CMakeFiles/far2m.dir/src/cache.cpp.o
/usr/bin/CC -DUNICODE -DUSELUA -DUSEUCD -Dfar2m_EXPORTS -I/home/user/src/far2m/utils/include -I/home/user/src/far2m/far/. -I/home/user/src/far2m/far/far2sdk -I/home/user/src/far2m/far/src -I/home/user/src/far2m/far/src/base -I/home/user/src/far2m/far/src/mix -I/home/user/src/far2m/far/src/bookmarks -I/home/user/src/far2m/far/src/cfg -I/home/user/src/far2m/far/src/console -I/home/user/src/far2m/far/src/filemask -I/home/user/src/far2m/far/src/hist -I/home/user/src/far2m/far/src/locale -I/home/user/src/far2m/far/src/macro -I/home/user/src/far2m/far/src/panels -I/home/user/src/far2m/far/src/plug -I/home/user/src/far2m/far/src/vt -I/home/user/src/far2m/_build/far -I/usr/local/include/uchardet -I/home/user/src/far2m/far/../WinPort -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -ffunction-sections -fdata-sections -Wl,--gc-sections -DWINPORT_REGISTRY  -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64 -O2 -fvisibility=hidden -std=c++11 -MD -MT far/CMakeFiles/far2m.dir/src/cache.cpp.o -MF far/CMakeFiles/far2m.dir/src/cache.cpp.o.d -o far/CMakeFiles/far2m.dir/src/cache.cpp.o -c /home/user/src/far2m/far/src/cache.cpp
In file included from /home/user/src/far2m/far/src/cache.cpp:32:
/home/user/src/far2m/far/src/headers.hpp:48:10: fatal error: malloc.h: No such file or directory
 #include <malloc.h>
          ^~~~~~~~~~

Решение: elfmz@1b96d70

Numeric Keys are not working in Far Editor

Test Case:

  1. Set keyboard NumLock to ENABLE
  2. Open Far editor for any file
  3. Press Alt+F8 for open "Go To Position" modal window
  4. Press any number on NumLock keyboard

Actual Result:

  1. There is no any number is entered.

Expected Result:

  1. Entered number should be displayed in "Go To Position" input field.

image

Асинхронный режим работы макроса

..при котором бы он не ждал окончания фаровской операции (типа копирования, подсчёта размера, построения дерева), которая была запущена клавишей из Keys.

Проблема: макродвижок по умолчанию "нажимает клавиши" синхронно: очередное нажатие возвращает управление после завершения операции, вызванной этим нажатием.
Поэтому текущая реализация предусматривает запрет обработки клавиатуры в процессе операции, что приводит к невозможности прервать (затянувшуюся) операцию штатным образом (Esc/CtrlBreak).

Потенциальное решение: предусмотреть возможность как-то явно указать, для определённых случаев, что синхронность не нужна. Например mf.mode(3) и/или Keys("EnAsync/NoWait",...).

Источник: https://bugs.farmanager.com/view.php?id=2692

GetPanelDirectory function paramerers in macro

I tried to use following macro in far2l with LuaMacro

Macro {
  area="Shell"; key="..."; flags=""; description="..."; action = function()
    panel.SetPanelDirectory(nil,0,panel.GetPanelDirectory(nil,1))
    if (((Bof and APanel.Root) or not Bof) and PPanel.Visible) then
        Panel.SetPath(1,PPanel.Path,APanel.Current)
    end
  end;
}

It shows following error text

.../Macros/scripts/test.lua:3: bad argument #1 to 'GetPanelDirectory' (integer or light userdata expected, got nil)

stack traceback:
                                                                                                                
[C]: in function 'GetPanelDirectory'

...

This macro works as expected in Far Manager ver. 3.0.xxxx for Windows.

Dependency of macro-keys on current keyboard language

  • Не вызываются макросы, назначенные на Alt+<буква> при русской раскладке клавиатуры, например, CtrlAltH.
  • Также, в режиме ручной записи макроса, нельзя назначить его на подобное кнопкосочетание, если активна русская
    раскладка клавиатуры.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.