Code Monkey home page Code Monkey logo

Comments (6)

junegunn avatar junegunn commented on June 15, 2024 1

You can just append --no-height at the end, because the last one wins.

export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --no-height"

from fzf.

Konfekt avatar Konfekt commented on June 15, 2024

With the same setup, non-ascii characters make Fzf quit; it's intricate

from fzf.

Konfekt avatar Konfekt commented on June 15, 2024

I found out that as soon as I removed the --height option from $FZF_DEFAULT_OPTS, fzf accepts non-ascii characters in Git Bash in Windows Terminal; however I could not make fzf work at all in Git bash.

Regarding the --height option, it's unfortunately set by almost all common commands, such as Ctrl-T.
The following lines, say in .bash_profile, remove it wherever possible:

  export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS//--height[=[:space:]][1-9][0-9]?/ }"
  export FZF_CTRL_T_OPTS="${FZF_CTRL_T_OPTS//--height[=[:space:]][1-9][0-9]?/ }"
  export FZF_CTRL_R_OPTS="${FZF_CTRL_R_OPTS//--height[=[:space:]][1-9][0-9]?/ }"

  export FZF_ALT_C_OPTS="${FZF_DEFAULT_OPTS} --preview='tree.com //F {} | tail +3 | head -\$LINES'"

Ideally, of course, the issue with setting --height in Fzf in Git Bash itself could be fixed.

from fzf.

Konfekt avatar Konfekt commented on June 15, 2024

Thank you, I was not aware of it. This is more robust. Ideally, since the provided bash scripts set their own custom parameters, add a check for Git Bash, say by [ -z ${MSYSTEM+x} ] || ..., and append --no-height.

from fzf.

sledgehammer999 avatar sledgehammer999 commented on June 15, 2024

I can confirm that --no-height works for me too. In both Windows Terminal and mintty(from git bash).
BTW echo $FZF_DEFAULT_OPTS is empty so I suppose --height is the default, right?

from fzf.

Konfekt avatar Konfekt commented on June 15, 2024

Yes, you can inspect here:

https://github.com/junegunn/fzf/blob/0994d9c881f8380997b96bb0a4a7416b50bc2b0d/shell/key-bindings.bash

__fzf_defaults() {
  # $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
  # $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
  echo "--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore $1"
  command cat "${FZF_DEFAULT_OPTS_FILE-}" 2> /dev/null
  echo "${FZF_DEFAULT_OPTS-} $2"
}


__fzf_select__() {
  FZF_DEFAULT_COMMAND=${FZF_CTRL_T_COMMAND:-} \
  FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --walker=file,dir,follow,hidden --scheme=path" "${FZF_CTRL_T_OPTS-} -m") \

from fzf.

Related Issues (20)

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.