Skip to content

v0.9.3: Alt+F filter, Alt+S sort popup, mouse control, smart config merge & auto-restart#3

Open
zirize wants to merge 7 commits into
la9527:masterfrom
zirize:master
Open

v0.9.3: Alt+F filter, Alt+S sort popup, mouse control, smart config merge & auto-restart#3
zirize wants to merge 7 commits into
la9527:masterfrom
zirize:master

Conversation

@zirize

@zirize zirize commented Mar 13, 2026

Copy link
Copy Markdown

Summary of Changes

This PR adds several new features and improvements developed in the fork:

New Features

Alt+F — Real-time file name filter

  • Press Alt+F to activate filter input in the active panel
  • As you type, only files whose names contain the string are shown (directories always visible)
  • Filter persists when navigating into subdirectories
  • Press ESC or Alt+F again to clear

Alt+S — Sort mode popup

  • Press Alt+S to open a popup menu for selecting sort mode on the fly
  • Options: None / Name / Ext / Size / Time / Color

Mouse control options

  • --nomouse / -M CLI flag to disable mouse input
  • LINM_NO_MOUSE environment variable
  • Mouse = On/Off setting in default.cfg

Ctrl+D reassigned to Quit only

  • Removed Ctrl+D from Cmd_Remove (delete); it remains only in Cmd_Quit

Improvements

Smart config merge on version upgrade

  • Instead of a Yes/No dialog that either overwrites all settings or ignores new keys:
    • Automatically backs up ~/.config/linm/*.cfg to back/
    • Merges only missing keys from system defaults (existing user settings preserved)
    • All 4 config files (default, keyset, colorset, syntexset) are checked independently
    • Restarts via execvp so all merged settings take effect immediately
  • New method: Configure::MergeFromFile()

F1 Help reorganized

  • Commands grouped into logical sections (navigation, file ops, view, filter/sort, etc.)
  • Missing commands added; display order made consistent

Documentation & Build

  • README.md and README.ko rewritten: cmake build guide, Korean install guide
  • .gitignore added for C++/CMake projects
  • ChangeLog updated; version bumped to 0.9.3

zirize and others added 7 commits March 14, 2026 02:12
…erge & restart

- Alt+F: real-time file name filter (dirs always shown, persists on cd, ESC to clear)
- Alt+S: sort mode popup (None/Name/Ext/Size/Time/Color)
- Mouse control: --nomouse/-M CLI flag, LINM_NO_MOUSE env var, Mouse=On/Off in default.cfg
- Ctrl+D: reassigned to Quit only (removed from Delete/Remove)
- Smart config merge on version upgrade: missing keys merged from system defaults,
  existing user settings preserved, old files backed up, execvp auto-restart
- Configure::MergeFromFile(): merges only absent keys from a config file
- All 4 cfg files (default/keyset/colorset/syntexset) checked individually for version mismatch
- F1 help reorganized into logical groups, missing commands added, display order guaranteed
- .gitignore added (C++/CMake project)
- README.md and README.ko updated with cmake build guide and Korean install guide

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
#ifdef __DEBUGMODE__ was always true because __DEBUGMODE__ is defined as 0.
Changed to #if __DEBUGMODE__ so the error dialog only appears in actual
debug builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- sprintf -> snprintf in mainframe.cpp, SMBReader.cpp
- strcpy -> memcpy in mlslocale.cpp
- Add ShellQuotePath() helper; quote all path args in system() calls
- Replace system("touch ...") with open() syscall to prevent shell injection
- Alt+F filter upgraded to std::regex (case-insensitive)
  - Falls back to substring match on invalid regex pattern
  - Filter bar shows [F/RE:...] for valid regex, [F/?:...] for invalid
- Bump version to 0.9.4

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Panel::Read() now accepts optional bShowError=false param to suppress
  error dialogs during silent startup path probing
- MainFrame::Init() uses ReadStartupPath() helper to try candidate paths
  in order (panel0: . -> ~ -> /; panel1: LastPath -> ~ -> . -> /)
- When LastPath falls back to a different path, auto-saves the new path
  to config so next startup works correctly
- Initialize() in main_ncurces.cpp gracefully handles missing cwd by
  falling back to home dir or / before ncurses init
- Fix NULL dereference in DirReader::GetCurrentPath() when getpwuid()
  returns NULL (e.g., uid not in /etc/passwd)
- Initialize _bFilterRegexValid in Panel::Init() to prevent UB

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…vailable

GetReader() (no-arg) returns _pReader which is NULL on first startup
before any successful read. When Read() fails on a nonexistent saved
path and GetConnected() is false, the fallback to GetReader() returned
NULL, causing a segfault.

Add null checks after both GetReader() fallback calls so Panel::Read
safely returns false, allowing ReadStartupPath to try the next path
(~, ., /).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@la9527 la9527 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zirize 관리를 요즘에 잘 안했는데, linm을 잘 이용해 주셔서 감사한데, 이렇게 PR 까지 손 수 전달해 주셔서 감사합니다.

다만 작업된 코드를 보니 디폴트 경로가 ~/.config/linm 의 디렉토리 경로로 처리하는 건 리눅스 패키지들의 일반적인 툴들의 설정 파일 디렉토리 구조는 아닌 것 같고, linm 초기 부터 ~/.linm 의 디렉토리를 사용해 변경하기는 좀 곤란합니다.

빌드 시 configuration 의 설정으로 기본 경로는 ~/.linm 을 두고,
cmake 빌드 시 configration 디렉로리 경로를 설정하는 방향으로 수정해 주시면 merge 진행하도록 하겠습니다.

다시 한번 감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants