Compare commits

..
Author SHA1 Message Date
Junegunn Choi 38040d43e4 Leverage existing bash completion
This is a PoC implementation for leveraging existing bash completion

git **<tab>
kubectl **<tab>
2024-09-30 19:08:28 +09:00
Junegunn Choi 4161403a1d --tmux: Export bash functions
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Fix #4001
2024-09-29 19:33:42 +09:00
junegunn 53bcdc4294 Deploying to master from @ junegunn/fzf@30a8ef28cd 🚀
CodeQL / Analyze (go) (push) Waiting to run
Test fzf on Linux / build (push) Waiting to run
Test fzf on macOS / build (push) Waiting to run
2024-09-29 00:02:07 +00:00
Koichi Murase 30a8ef28cd [bash] Fix infinite retry loop for completion setting without "-F func" (#4004)
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
2024-09-23 19:16:59 +09:00
junegunn 855f90727a Deploying to master from @ junegunn/fzf@2191a44e36 🚀
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
2024-09-15 00:02:03 +00:00
Junegunn Choi 2191a44e36 Redraw/hide scroll offset when 'info' property is changed
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
2024-09-12 22:04:19 +09:00
Junegunn Choi 952276dc2d Add 'noinfo' option to hide scroll offset information in preview window
CodeQL / Analyze (go) (push) Waiting to run
Test fzf on Linux / build (push) Waiting to run
Test fzf on macOS / build (push) Waiting to run
fzf --preview 'seq 1000' --preview-window noinfo

Close #2525
2024-09-12 18:31:14 +09:00
dependabot[bot] 2286edb329 Bump golang.org/x/term from 0.23.0 to 0.24.0 (#3991)
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.23.0 to 0.24.0.
- [Commits](https://github.com/golang/term/compare/v0.23.0...v0.24.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 21:25:57 +09:00
junegunn a0f28583e7 Deploying to master from @ junegunn/fzf@8af0af3400 🚀
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2024-09-08 00:02:05 +00:00
Junegunn Choi 8af0af3400 Highlights
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
Close #3942
2024-09-01 16:20:25 +09:00
junegunn 769e5cbb2d Deploying to master from @ junegunn/fzf@fc69308057 🚀
CodeQL / Analyze (go) (push) Waiting to run
Test fzf on Linux / build (push) Waiting to run
Test fzf on macOS / build (push) Waiting to run
2024-09-01 00:02:21 +00:00
13 changed files with 122 additions and 46 deletions

No files matched your search

+7 -8
View File
@@ -28,14 +28,13 @@ history, processes, hostnames, bookmarks, git commits, etc. It implements
a "fuzzy" matching algorithm, so you can quickly type in patterns with omitted a "fuzzy" matching algorithm, so you can quickly type in patterns with omitted
characters and still get the results you want. characters and still get the results you want.
Pros Highlights
---- ----------
- Portable, no dependencies - 📦 **Portable** — Distributed as a single binary for easy installation
- Blazingly fast - ⚡ **Blazingly fast** — Highly optimized code instantly processes millions of items
- Extremely versatile - 🛠️ **Extremely versatile** — Fully customizable via an event-action binding mechanism
- Batteries included - 🔋 **Batteries included** — Includes integration with bash, zsh, fish, Vim, and Neovim
- bash/zsh/fish integration, tmux integration, Vim/Neovim plugin
Sponsors ❤️ Sponsors ❤️
----------- -----------
@@ -44,7 +43,7 @@ I would like to thank all the sponsors of this project who make it possible for
If you'd like to sponsor this project, please visit https://github.com/sponsors/junegunn. If you'd like to sponsor this project, please visit https://github.com/sponsors/junegunn.
<!-- sponsors --><a href="https://github.com/miyanokomiya"><img src="https://github.com/miyanokomiya.png" width="60px" alt="miyanokomiya" /></a><a href="https://github.com/jonhoo"><img src="https://github.com/jonhoo.png" width="60px" alt="Jon Gjengset" /></a><a href="https://github.com/AceofSpades5757"><img src="https://github.com/AceofSpades5757.png" width="60px" alt="Kyle L. Davis" /></a><a href="https://github.com/Frederick888"><img src="https://github.com/Frederick888.png" width="60px" alt="Frederick Zhang" /></a><a href="https://github.com/moritzdietz"><img src="https://github.com/moritzdietz.png" width="60px" alt="Moritz Dietz" /></a><a href="https://github.com/mikker"><img src="https://github.com/mikker.png" width="60px" alt="Mikkel Malmberg" /></a><a href="https://github.com/pldubouilh"><img src="https://github.com/pldubouilh.png" width="60px" alt="Pierre Dubouilh" /></a><a href="https://github.com/trantor"><img src="https://github.com/trantor.png" width="60px" alt="Fulvio Scapin" /></a><a href="https://github.com/rcorre"><img src="https://github.com/rcorre.png" width="60px" alt="Ryan Roden-Corrent" /></a><a href="https://github.com/blissdev"><img src="https://github.com/blissdev.png" width="60px" alt="Jordan Arentsen" /></a><a href="https://github.com/mislav"><img src="https://github.com/mislav.png" width="60px" alt="Mislav Marohnić" /></a><a href="https://github.com/aexvir"><img src="https://github.com/aexvir.png" width="60px" alt="Alex Viscreanu" /></a><a href="https://github.com/dbalatero"><img src="https://github.com/dbalatero.png" width="60px" alt="David Balatero" /></a><a href="https://github.com/moobar"><img src="https://github.com/moobar.png" width="60px" alt="" /></a><a href="https://github.com/majjoha"><img src="https://github.com/majjoha.png" width="60px" alt="Mathias Jean Johansen" /></a><a href="https://github.com/benelan"><img src="https://github.com/benelan.png" width="60px" alt="Ben Elan" /></a><a href="https://github.com/pawelduda"><img src="https://github.com/pawelduda.png" width="60px" alt="Paweł Duda" /></a><a href="https://github.com/slezica"><img src="https://github.com/slezica.png" width="60px" alt="Santiago Lezica" /></a><a href="https://github.com/pbwn"><img src="https://github.com/pbwn.png" width="60px" alt="" /></a><a href="https://github.com/timgluz"><img src="https://github.com/timgluz.png" width="60px" alt="Timo Sulg" /></a><a href="https://github.com/pyrho"><img src="https://github.com/pyrho.png" width="60px" alt="Damien Rajon" /></a><a href="https://github.com/ArtBIT"><img src="https://github.com/ArtBIT.png" width="60px" alt="ArtBIT" /></a><a href="https://github.com/da-moon"><img src="https://github.com/da-moon.png" width="60px" alt="" /></a><a href="https://github.com/jiangyinzuo"><img src="https://github.com/jiangyinzuo.png" width="60px" alt="Yinzuo Jiang" /></a><a href="https://github.com/hovissimo"><img src="https://github.com/hovissimo.png" width="60px" alt="Hovis" /></a><a href="https://github.com/dariusjonda"><img src="https://github.com/dariusjonda.png" width="60px" alt="Darius Jonda" /></a><a href="https://github.com/cristiand391"><img src="https://github.com/cristiand391.png" width="60px" alt="Cristian Dominguez" /></a><a href="https://github.com/eliangcs"><img src="https://github.com/eliangcs.png" width="60px" alt="Chang-Hung Liang" /></a><a href="https://github.com/asphaltbuffet"><img src="https://github.com/asphaltbuffet.png" width="60px" alt="Ben Lechlitner" /></a><a href="https://github.com/yash1th"><img src="https://github.com/yash1th.png" width="60px" alt="yash" /></a><a href="https://github.com/looshch"><img src="https://github.com/looshch.png" width="60px" alt="george looshch" /></a><a href="https://github.com/kg8m"><img src="https://github.com/kg8m.png" width="60px" alt="Takumi KAGIYAMA" /></a><a href="https://github.com/polm"><img src="https://github.com/polm.png" width="60px" alt="Paul OLeary McCann" /></a><a href="https://github.com/rbeeger"><img src="https://github.com/rbeeger.png" width="60px" alt="Robert Beeger" /></a><a href="https://github.com/veebch"><img src="https://github.com/veebch.png" width="60px" alt="VEEB Projects" /></a><a href="https://github.com/yowayb"><img src="https://github.com/yowayb.png" width="60px" alt="Yoway Buorn" /></a><a href="https://github.com/scalisi"><img src="https://github.com/scalisi.png" width="60px" alt="Josh Scalisi" /></a><a href="https://github.com/alecbcs"><img src="https://github.com/alecbcs.png" width="60px" alt="Alec Scott" /></a><a href="https://github.com/thnxdev"><img src="https://github.com/thnxdev.png" width="60px" alt="thanks.dev" /></a><a href="https://github.com/artursapek"><img src="https://github.com/artursapek.png" width="60px" alt="Artur Sapek" /></a><a href="https://github.com/ramnes"><img src="https://github.com/ramnes.png" width="60px" alt="Guillaume Gelin" /></a><a href="https://github.com/jyc"><img src="https://github.com/jyc.png" width="60px" alt="" /></a><a href="https://githubLine truncated <!-- sponsors --><a href="https://github.com/miyanokomiya"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;20733354?u&#x3D;363dbf6d7becb19a848535228189abc7b263697c&amp;v&#x3D;4" width="60px" alt="miyanokomiya" /></a><a href="https://github.com/jonhoo"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;176295?u&#x3D;264ece14e9ef7ce507becbaecc6b4ac4271d4e4f&amp;v&#x3D;4" width="60px" alt="Jon Gjengset" /></a><a href="https://github.com/AceofSpades5757"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;10341888?u&#x3D;996946cf9555e309a6a1fd03d2c72080217b4999&amp;v&#x3D;4" width="60px" alt="Kyle L. Davis" /></a><a href="https://github.com/Frederick888"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;4507647?u&#x3D;8feed5449181b62831b6f4f526cf2c075d7833b2&amp;v&#x3D;4" width="60px" alt="Frederick Zhang" /></a><a href="https://github.com/moritzdietz"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;7935536?u&#x3D;79a728c053f252e08eb2b3d1030569058c8f6c63&amp;v&#x3D;4" width="60px" alt="Moritz Dietz" /></a><a href="https://github.com/mikker"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2819?u&#x3D;6a2ada89a4baf89ee431d6940ed674cb46eceb88&amp;v&#x3D;4" width="60px" alt="Mikkel Malmberg" /></a><a href="https://github.com/pldubouilh"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;760637?u&#x3D;476f763b74ce175e0c6d74789b304ad94ecddd4b&amp;v&#x3D;4" width="60px" alt="Pierre Dubouilh" /></a><a href="https://github.com/trantor"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;69568?v&#x3D;4" width="60px" alt="Fulvio Scapin" /></a><a href="https://github.com/rcorre"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2496231?u&#x3D;2a46dcfdbcdc02f29ac395d8de5efd222fa174bc&amp;v&#x3D;4" width="60px" alt="Ryan Roden-Corrent" /></a><a href="https://github.com/blissdev"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;3456?v&#x3D;4" width="60px" alt="Jordan Arentsen" /></a><a href="https://github.com/mislav"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;887?u&#x3D;5ce21332bfb47e39de1fddeb28b4192d1f8d543a&amp;v&#x3D;4" width="60px" alt="Mislav Marohnić" /></a><a href="https://github.com/aexvir"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8055505?u&#x3D;3cc5cc4daba1b0eb027c6b20b29720831832025d&amp;v&#x3D;4" width="60px" alt="Alex Viscreanu" /></a><a href="https://github.com/dbalatero"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;59429?u&#x3D;67d5158d381fa28b0ce849b3976dc7c8ac1faa54&amp;v&#x3D;4" width="60px" alt="David Balatero" /></a><a href="https://github.com/moobar"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;4176540?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/majjoha"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;233988?v&#x3D;4" width="60px" alt="Mathias Jean Johansen" /></a><a href="https://github.com/benelan"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;10986395?u&#x3D;44009e8406b0a1f2487a2710e0763b345590fa7c&amp;v&#x3D;4" width="60px" alt="Ben Elan" /></a><a href="https://github.com/pawelduda"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;3728827?u&#x3D;18306be396fdb2560e04ff5db57d9024c40ec561&amp;v&#x3D;4" width="60px" alt="Paweł Duda" /></a><a href="https://github.com/slezica"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;321596?u&#x3D;8423ec39c6f046851335d192a5837cc0f0336be3&amp;v&#x3D;4" width="60px" alt="Santiago Lezica" /></a><a href="https://github.com/pbwn"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;34809091?u&#x3D;5a0fbe67ca5c1df360398daf2700a5d69ee91904&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/timgluz"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1223889?u&#x3D;a13c54a9e52d336ac32a11b23e4295e47c6caf4c&amp;v&#x3D;4" width="60px" alt="Timo Sulg" /></a><a href="https://github.com/pyrho"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;145502?v&#x3D;4" width="60px" alt="Damien Rajon" /></a><a href="https://github.com/ArtBIT"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;184220?u&#x3D;cc51cc2de93c463e38b11debb64d4bf1c248cfe3&amp;v&#x3D;4" width="60px" alt="ArtBIT" /></a><a href="https://github.com/da-moon"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;17126777?u&#x3D;6b7aeb3f4c9011efba1719ca1d22ba5fd810007a&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/hovissimo"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;6434414?u&#x3D;e58fccf7558d7e3a4ab209a560afc2cd45460af1&amp;v&#x3D;4" width="60px" alt="Hovis" /></a><a href="https://github.com/dariusjonda"><img src="https:&#x2F;&#x2F;avatars.githubusercontentLine truncated
Table of Contents Table of Contents
----------------- -----------------
+2 -2
View File
@@ -6,8 +6,8 @@ require (
github.com/junegunn/go-shellwords v0.0.0-20240813092932-a62c48c52e97 github.com/junegunn/go-shellwords v0.0.0-20240813092932-a62c48c52e97
github.com/mattn/go-isatty v0.0.20 github.com/mattn/go-isatty v0.0.20
github.com/rivo/uniseg v0.4.7 github.com/rivo/uniseg v0.4.7
golang.org/x/sys v0.24.0 golang.org/x/sys v0.25.0
golang.org/x/term v0.23.0 golang.org/x/term v0.24.0
) )
require ( require (
+4 -4
View File
@@ -36,14 +36,14 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+5 -2
View File
@@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
.. ..
.TH fzf 1 "Aug 2024" "fzf 0.55.0" "fzf - a command-line fuzzy finder" .TH fzf 1 "Sep 2024" "fzf 0.56.0" "fzf - a command-line fuzzy finder"
.SH NAME .SH NAME
fzf - a command-line fuzzy finder fzf - a command-line fuzzy finder
@@ -756,7 +756,7 @@ default value 0 (or \fBcenter\fR) will put the label at the center of the
border line. border line.
.TP .TP
.BI "\-\-preview\-window=" "[POSITION][,SIZE[%]][,border\-BORDER_OPT][,[no]wrap][,[no]follow][,[no]cycle][,[no]hidden][,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES][,default][,<SIZE_THRESHOLD(ALTERNATIVE_LAYOUT)]" .BI "\-\-preview\-window=" "[POSITION][,SIZE[%]][,border\-BORDER_OPT][,[no]wrap][,[no]follow][,[no]cycle][,[no]info][,[no]hidden][,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES][,default][,<SIZE_THRESHOLD(ALTERNATIVE_LAYOUT)]"
.RS .RS
.B POSITION: (default: right) .B POSITION: (default: right)
@@ -790,6 +790,9 @@ e.g.
* Cyclic scrolling is enabled with \fBcycle\fR flag. * Cyclic scrolling is enabled with \fBcycle\fR flag.
* To hide the scroll offset information on the top right corner, specify
\fBnoinfo\fR.
* To change the style of the border of the preview window, specify one of * To change the style of the border of the preview window, specify one of
the options for \fB\-\-border\fR with \fBborder\-\fR prefix. the options for \fB\-\-border\fR with \fBborder\-\fR prefix.
e.g. \fBborder\-rounded\fR (border with rounded edges, default), e.g. \fBborder\-rounded\fR (border with rounded edges, default),
+30 -2
View File
@@ -264,6 +264,7 @@ _fzf_handle_dynamic_completion() {
# _completion_loader may not have updated completion for the command # _completion_loader may not have updated completion for the command
if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then
__fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null) __fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null)
__fzf_orig_completion_get_orig_func "$cmd" || ret=1
# Update orig_complete by _fzf_orig_completion entry # Update orig_complete by _fzf_orig_completion entry
[[ $orig_complete =~ ' -F '(_fzf_[^ ]+)' ' ]] && [[ $orig_complete =~ ' -F '(_fzf_[^ ]+)' ' ]] &&
@@ -282,7 +283,7 @@ _fzf_handle_dynamic_completion() {
} }
__fzf_generic_path_completion() { __fzf_generic_path_completion() {
local cur base dir leftover matches trigger cmd local cur base dir leftover matches trigger cmd rest
cmd="${COMP_WORDS[0]}" cmd="${COMP_WORDS[0]}"
if [[ $cmd == \\* ]]; then if [[ $cmd == \\* ]]; then
cmd="${cmd:1}" cmd="${cmd:1}"
@@ -294,6 +295,16 @@ __fzf_generic_path_completion() {
base=${cur:0:${#cur}-${#trigger}} base=${cur:0:${#cur}-${#trigger}}
eval "base=$base" 2> /dev/null || return eval "base=$base" 2> /dev/null || return
# Try to leverage existing completion
rest=("${@:4}")
unset 'rest[${#rest[@]}-2]'
COMP_LINE=${COMP_LINE:0:${#COMP_LINE}-${#trigger}}
COMP_POINT=$((COMP_POINT-${#trigger}))
COMP_WORDS[$COMP_CWORD]=$base
_fzf_handle_dynamic_completion "$cmd" "${rest[@]}"
[[ $? -ne 0 ]] &&
_fzf_handle_dynamic_completion "$cmd" "${rest[@]}"
dir= dir=
[[ $base = *"/"* ]] && dir="$base" [[ $base = *"/"* ]] && dir="$base"
while true; do while true; do
@@ -305,7 +316,11 @@ __fzf_generic_path_completion() {
matches=$( matches=$(
export FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --scheme=path" "${FZF_COMPLETION_OPTS-} $2") export FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --scheme=path" "${FZF_COMPLETION_OPTS-} $2")
unset FZF_DEFAULT_COMMAND FZF_DEFAULT_OPTS_FILE unset FZF_DEFAULT_COMMAND FZF_DEFAULT_OPTS_FILE
if declare -F "$1" > /dev/null; then if [[ ${#COMPREPLY[@]} -gt 0 ]]; then
for h in "${COMPREPLY[@]}"; do
echo "$h"
done | command sort -u | __fzf_comprun "$4" -q "$leftover"
elif declare -F "$1" > /dev/null; then
eval "$1 $(printf %q "$dir")" | __fzf_comprun "$4" -q "$leftover" eval "$1 $(printf %q "$dir")" | __fzf_comprun "$4" -q "$leftover"
else else
if [[ $1 =~ dir ]]; then if [[ $1 =~ dir ]]; then
@@ -373,7 +388,20 @@ _fzf_complete() {
if [[ "$cur" == *"$trigger" ]] && [[ $cur != *'$('* ]] && [[ $cur != *':='* ]] && [[ $cur != *'`'* ]]; then if [[ "$cur" == *"$trigger" ]] && [[ $cur != *'$('* ]] && [[ $cur != *':='* ]] && [[ $cur != *'`'* ]]; then
cur=${cur:0:${#cur}-${#trigger}} cur=${cur:0:${#cur}-${#trigger}}
# Try to leverage existing completion
COMP_LINE=${COMP_LINE:0:${#COMP_LINE}-${#trigger}}
COMP_POINT=$((COMP_POINT-${#trigger}))
unset 'rest[${#rest[@]}-2]'
_fzf_handle_dynamic_completion "$cmd" "${rest[@]}"
[[ $? -ne 0 ]] &&
_fzf_handle_dynamic_completion "$cmd" "${rest[@]}"
selected=$( selected=$(
(if [[ ${#COMPREPLY[@]} -gt 0 ]]; then
for h in "${COMPREPLY[@]}"; do
echo "$h"
done
fi; cat) | command sort -u |
FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse" "${FZF_COMPLETION_OPTS-} $str_arg") \ FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse" "${FZF_COMPLETION_OPTS-} $str_arg") \
FZF_DEFAULT_OPTS_FILE='' \ FZF_DEFAULT_OPTS_FILE='' \
__fzf_comprun "${rest[0]}" "${args[@]}" -q "$cur" | $post | command tr '\n' ' ') __fzf_comprun "${rest[0]}" "${args[@]}" -q "$cur" | $post | command tr '\n' ' ')
+9 -4
View File
@@ -120,8 +120,8 @@ Usage: fzf [options]
--preview=COMMAND Command to preview highlighted line ({}) --preview=COMMAND Command to preview highlighted line ({})
--preview-window=OPT Preview window layout (default: right:50%) --preview-window=OPT Preview window layout (default: right:50%)
[up|down|left|right][,SIZE[%]] [up|down|left|right][,SIZE[%]]
[,[no]wrap][,[no]cycle][,[no]follow][,[no]hidden] [,[no]wrap][,[no]cycle][,[no]follow][,[no]info]
[,border-BORDER_OPT] [,[no]hidden][,border-BORDER_OPT]
[,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES] [,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES]
[,default][,<SIZE_THRESHOLD(ALTERNATIVE_LAYOUT)] [,default][,<SIZE_THRESHOLD(ALTERNATIVE_LAYOUT)]
--preview-label=LABEL --preview-label=LABEL
@@ -271,6 +271,7 @@ type previewOpts struct {
wrap bool wrap bool
cycle bool cycle bool
follow bool follow bool
info bool
border tui.BorderShape border tui.BorderShape
headerLines int headerLines int
threshold int threshold int
@@ -386,7 +387,7 @@ func (a previewOpts) sameLayout(b previewOpts) bool {
} }
func (a previewOpts) sameContentLayout(b previewOpts) bool { func (a previewOpts) sameContentLayout(b previewOpts) bool {
return a.wrap == b.wrap && a.headerLines == b.headerLines return a.wrap == b.wrap && a.headerLines == b.headerLines && a.info == b.info
} }
func firstLine(s string) string { func firstLine(s string) string {
@@ -508,7 +509,7 @@ func filterNonEmpty(input []string) []string {
} }
func defaultPreviewOpts(command string) previewOpts { func defaultPreviewOpts(command string) previewOpts {
return previewOpts{command, posRight, sizeSpec{50, true}, "", false, false, false, false, tui.DefaultBorderShape, 0, 0, nil} return previewOpts{command, posRight, sizeSpec{50, true}, "", false, false, false, false, true, tui.DefaultBorderShape, 0, 0, nil}
} }
func defaultOptions() *Options { func defaultOptions() *Options {
@@ -1789,6 +1790,10 @@ func parsePreviewWindowImpl(opts *previewOpts, input string) error {
opts.follow = true opts.follow = true
case "nofollow": case "nofollow":
opts.follow = false opts.follow = false
case "info":
opts.info = true
case "noinfo":
opts.info = false
default: default:
if headerRegex.MatchString(token) { if headerRegex.MatchString(token) {
if opts.headerLines, err = atoi(token[1:]); err != nil { if opts.headerLines, err = atoi(token[1:]); err != nil {
+17 -5
View File
@@ -9,6 +9,7 @@ import (
"os/exec" "os/exec"
"os/signal" "os/signal"
"path/filepath" "path/filepath"
"regexp"
"strings" "strings"
"time" "time"
@@ -32,7 +33,7 @@ func fifo(name string) (string, error) {
return output, nil return output, nil
} }
func runProxy(commandPrefix string, cmdBuilder func(temp string) *exec.Cmd, opts *Options, withExports bool) (int, error) { func runProxy(commandPrefix string, cmdBuilder func(temp string, needBash bool) (*exec.Cmd, error), opts *Options, withExports bool) (int, error) {
output, err := fifo("proxy-output") output, err := fifo("proxy-output")
if err != nil { if err != nil {
return ExitError, err return ExitError, err
@@ -92,17 +93,28 @@ func runProxy(commandPrefix string, cmdBuilder func(temp string) *exec.Cmd, opts
// To ensure that the options are processed by a POSIX-compliant shell, // To ensure that the options are processed by a POSIX-compliant shell,
// we need to write the command to a temporary file and execute it with sh. // we need to write the command to a temporary file and execute it with sh.
var exports []string var exports []string
needBash := false
if withExports { if withExports {
exports = os.Environ() validIdentifier := regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`)
for idx, pairStr := range exports { for _, pairStr := range os.Environ() {
pair := strings.SplitN(pairStr, "=", 2) pair := strings.SplitN(pairStr, "=", 2)
exports[idx] = fmt.Sprintf("export %s=%s", pair[0], escapeSingleQuote(pair[1])) if validIdentifier.MatchString(pair[0]) {
exports = append(exports, fmt.Sprintf("export %s=%s", pair[0], escapeSingleQuote(pair[1])))
} else if strings.HasPrefix(pair[0], "BASH_FUNC_") && strings.HasSuffix(pair[0], "%%") {
name := pair[0][10 : len(pair[0])-2]
exports = append(exports, name+pair[1])
exports = append(exports, "export -f "+name)
needBash = true
}
} }
} }
temp := WriteTemporaryFile(append(exports, command), "\n") temp := WriteTemporaryFile(append(exports, command), "\n")
defer os.Remove(temp) defer os.Remove(temp)
cmd := cmdBuilder(temp) cmd, err := cmdBuilder(temp, needBash)
if err != nil {
return ExitError, err
}
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
intChan := make(chan os.Signal, 1) intChan := make(chan os.Signal, 1)
defer close(intChan) defer close(intChan)
+4 -1
View File
@@ -9,7 +9,10 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )
func sh() (string, error) { func sh(bash bool) (string, error) {
if bash {
return "bash", nil
}
return "sh", nil return "sh", nil
} }
+9 -5
View File
@@ -13,12 +13,16 @@ import (
var shPath atomic.Value var shPath atomic.Value
func sh() (string, error) { func sh(bash bool) (string, error) {
if cached := shPath.Load(); cached != nil { if cached := shPath.Load(); cached != nil {
return cached.(string), nil return cached.(string), nil
} }
cmd := exec.Command("cygpath", "-w", "/usr/bin/sh") name := "sh"
if bash {
name = "bash"
}
cmd := exec.Command("cygpath", "-w", "/usr/bin/"+name)
bytes, err := cmd.Output() bytes, err := cmd.Output()
if err != nil { if err != nil {
return "", err return "", err
@@ -31,7 +35,7 @@ func sh() (string, error) {
func mkfifo(path string, mode uint32) (string, error) { func mkfifo(path string, mode uint32) (string, error) {
m := strconv.FormatUint(uint64(mode), 8) m := strconv.FormatUint(uint64(mode), 8)
sh, err := sh() sh, err := sh(false)
if err != nil { if err != nil {
return path, err return path, err
} }
@@ -43,7 +47,7 @@ func mkfifo(path string, mode uint32) (string, error) {
} }
func withOutputPipe(output string, task func(io.ReadCloser)) error { func withOutputPipe(output string, task func(io.ReadCloser)) error {
sh, err := sh() sh, err := sh(false)
if err != nil { if err != nil {
return err return err
} }
@@ -62,7 +66,7 @@ func withOutputPipe(output string, task func(io.ReadCloser)) error {
} }
func withInputPipe(input string, task func(io.WriteCloser)) error { func withInputPipe(input string, task func(io.WriteCloser)) error {
sh, err := sh() sh, err := sh(false)
if err != nil { if err != nil {
return err return err
} }
+1 -1
View File
@@ -2507,7 +2507,7 @@ func (t *Terminal) renderPreviewSpinner() {
spin := t.previewer.spinner spin := t.previewer.spinner
if len(spin) > 0 || t.previewer.scrollable { if len(spin) > 0 || t.previewer.scrollable {
maxWidth := t.pwindow.Width() maxWidth := t.pwindow.Width()
if !t.previewer.scrollable { if !t.previewer.scrollable || !t.previewOpts.info {
if maxWidth > 0 { if maxWidth > 0 {
t.pwindow.Move(0, maxWidth-1) t.pwindow.Move(0, maxWidth-1)
t.pwindow.CPrint(tui.ColPreviewSpinner, spin) t.pwindow.CPrint(tui.ColPreviewSpinner, spin)
+6 -3
View File
@@ -49,9 +49,12 @@ func runTmux(args []string, opts *Options) (int, error) {
tmuxArgs = append(tmuxArgs, "-w"+opts.Tmux.width.String()) tmuxArgs = append(tmuxArgs, "-w"+opts.Tmux.width.String())
tmuxArgs = append(tmuxArgs, "-h"+opts.Tmux.height.String()) tmuxArgs = append(tmuxArgs, "-h"+opts.Tmux.height.String())
return runProxy(argStr, func(temp string) *exec.Cmd { return runProxy(argStr, func(temp string, needBash bool) (*exec.Cmd, error) {
sh, _ := sh() sh, err := sh(needBash)
if err != nil {
return nil, err
}
tmuxArgs = append(tmuxArgs, sh, temp) tmuxArgs = append(tmuxArgs, sh, temp)
return exec.Command("tmux", tmuxArgs...) return exec.Command("tmux", tmuxArgs...), nil
}, opts, true) }, opts, true)
} }
+14 -9
View File
@@ -44,11 +44,6 @@ func needWinpty(opts *Options) bool {
} }
func runWinpty(args []string, opts *Options) (int, error) { func runWinpty(args []string, opts *Options) (int, error) {
sh, err := sh()
if err != nil {
return ExitError, err
}
argStr := escapeSingleQuote(args[0]) argStr := escapeSingleQuote(args[0])
for _, arg := range args[1:] { for _, arg := range args[1:] {
argStr += " " + escapeSingleQuote(arg) argStr += " " + escapeSingleQuote(arg)
@@ -56,20 +51,30 @@ func runWinpty(args []string, opts *Options) (int, error) {
argStr += ` --no-winpty` argStr += ` --no-winpty`
if isMintty345() { if isMintty345() {
return runProxy(argStr, func(temp string) *exec.Cmd { return runProxy(argStr, func(temp string, needBash bool) (*exec.Cmd, error) {
sh, err := sh(needBash)
if err != nil {
return nil, err
}
cmd := exec.Command(sh, temp) cmd := exec.Command(sh, temp)
cmd.Env = append(os.Environ(), "MSYS=enable_pcon") cmd.Env = append(os.Environ(), "MSYS=enable_pcon")
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
return cmd return cmd, nil
}, opts, false) }, opts, false)
} }
return runProxy(argStr, func(temp string) *exec.Cmd { return runProxy(argStr, func(temp string, needBash bool) (*exec.Cmd, error) {
sh, err := sh(needBash)
if err != nil {
return nil, err
}
cmd := exec.Command(sh, "-c", fmt.Sprintf(`winpty < /dev/tty > /dev/tty -- sh %q`, temp)) cmd := exec.Command(sh, "-c", fmt.Sprintf(`winpty < /dev/tty > /dev/tty -- sh %q`, temp))
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
return cmd return cmd, nil
}, opts, false) }, opts, false)
} }
+14
View File
@@ -3378,6 +3378,20 @@ class TestGoFZF < TestBase
assert_equal expected, result assert_equal expected, result
end end
end end
def test_preview_window_noinfo
# │ 1 ││
tmux.send_keys %(#{FZF} --preview 'seq 1000' --preview-window top,noinfo --scrollbar --bind space:change-preview-window:info), :Enter
tmux.until do |lines|
assert lines[1]&.start_with?('│ 1')
assert lines[1]&.end_with?(' ││')
end
tmux.send_keys :Space
tmux.until do |lines|
assert lines[1]&.start_with?('│ 1')
assert lines[1]&.end_with?('1000││')
end
end
end end
module TestShell module TestShell