I've been using lf on both Windows and Linux and ran into several friction points when trying to share a single config file between platforms. I've put together a draft PR (#2418) with a set of changes that address these, and wanted to check whether there's appetite for this kind of improvement before investing more time polishing it.
What the PR addresses
- Dot file hiding on Windows:
zh now hides files starting with . in addition to the Windows FILE_ATTRIBUTE_HIDDEN attribute, matching Linux behavior
- Shell flag auto-correction: when
shell is set to sh/bash (common with Git Bash), the default /c shellflag is automatically corrected to -c
- Shebang-aware script execution: previewer/cleaner scripts with a
#!/bin/sh shebang are automatically run through the configured shell instead of failing with "executable not found"
- Relative path and env var expansion for
previewer, cleaner, rulerfile, and source
Motivation
The overall goal is to make it practical to share one lfrc and one previewer script between Windows and Linux without platform-specific wrappers. Currently users need separate config files or .cmd wrapper scripts to work around these issues.
As a concrete example, my own config at https://github.com/vivainio/dotfiles/blob/master/lf is now shared between Windows and Linux with no platform-specific files.
PR: #2418
Happy to split into separate PRs per change, add tests, or adjust the approach based on feedback.
I've been using lf on both Windows and Linux and ran into several friction points when trying to share a single config file between platforms. I've put together a draft PR (#2418) with a set of changes that address these, and wanted to check whether there's appetite for this kind of improvement before investing more time polishing it.
What the PR addresses
zhnow hides files starting with.in addition to the WindowsFILE_ATTRIBUTE_HIDDENattribute, matching Linux behaviorshellis set tosh/bash(common with Git Bash), the default/cshellflag is automatically corrected to-c#!/bin/shshebang are automatically run through the configured shell instead of failing with "executable not found"previewer,cleaner,rulerfile, andsourceMotivation
The overall goal is to make it practical to share one
lfrcand one previewer script between Windows and Linux without platform-specific wrappers. Currently users need separate config files or.cmdwrapper scripts to work around these issues.As a concrete example, my own config at https://github.com/vivainio/dotfiles/blob/master/lf is now shared between Windows and Linux with no platform-specific files.
PR: #2418
Happy to split into separate PRs per change, add tests, or adjust the approach based on feedback.