Comments (4)
I'm guessing you have sh
linked to fish
, so with the default setting set shell sh
, all shell commands will be interpreted by fish
. If you want to use a different shell within lf
, then just configure something like set shell bash
.
from lf.
@joelim-work Thanks for your replay. I don't have a linked sh
for fish
. But even I have a linked sh
for fish
maybe the better way is using the absolute path for this shell interpreter.
set shell bash
cmd rg_search ${{
res="$( \
RG_PREFIX="rg --column \
--hidden \
--line-number \
--no-heading \
--no-ignore \
--glob '!.git/*' \
--color=always \
--smart-case "
preview="
filepath=\$(echo {}|awk -F ':' '{print \$1}')
currentline=\$(echo {}|awk -F : '{print \$2}')
startline=\$([ \$currentline -ge 50 ] && expr \$currentline - 50 || expr 0)
endline=\$(expr \$currentline + 50)
bat -n --line-range \$startline:\$endline --highlight-line \$currentline --color always \$filepath
"
FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
--ansi --header 'Search in files' \
--preview "$preview" \
| cut -d':' -f1
)"
[ ! -z "$res" ] && lf -remote "send $id select \"$res\""
}}
map fs :rg_search
I use chsh
to switch shell and test the case.
When I switched to zsh works fine, while with fish shell failed and show the top error. Not test for bash.
from lf.
When executing shell commands (e.g. map x $var=123; echo "$var"
), lf
uses the shell that's configured using set shell ...
.
Your login shell (set using chsh
) is not relevant here.
Here is a more minimal config example:
set shell bash
# set shell fish
# set shell zsh
map x $var=123; echo "$var"
For me set shell bash
and set shell zsh
work, but set shell fish
doesn't, which is what I would expect since var=123
isn't valid syntax in fish
.
from lf.
I am facing the same issue with integrations for my fish shell even though I have set shell fish
I found it works when I convert the integration to compatible with fish
from lf.
Related Issues (20)
- lf image preview flickering HOT 5
- Duplicate icon
- Mouse buttons don't work
- Preview window colors HOT 14
- Yank path w/filename, filename, and file (As in Ranger) in Powershell HOT 6
- [QUESTION] Paste with overwrite for multiple files HOT 5
- Main Column Line Numbers Only HOT 8
- Outdated file information for recreated directories HOT 9
- directories have another font type HOT 2
- Feature request: highlighting of cursors when inactive HOT 3
- Feature request: add an lfrc switch to move duplicate copy suffixes at the beginning of filename. HOT 4
- `autoquit` should be enabled by default HOT 6
- how to use fribidi within lf.
- sixel preview writes out of bounds
- Broken characters of dir when I use `-print-last-dir` option / change drive option `/d` in `lfcd.cmd` HOT 3
- Issue with scrolling using alt key HOT 6
- Feature request: precalculate previews for files around the cursor HOT 3
- lf does not open terminal text editor when going right HOT 4
- Multishell/Crossplatform handling of `--` HOT 3
- how to use `lf -remote` in cmd? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lf.