Skip to content

Commit

Permalink
fix: config issues when user hasn't set FZF_DEFAULT_OPTS
Browse files Browse the repository at this point in the history
The important fzf options that I ensured would not be overridden by a
user's FZF_DEFAULT_OPTS were not being applied if the environment
variable was unset. The important options are:

    --no-select-1 --ansi --no-multi

This caused ansi escape sequences to not be handled properly, leading to
garbled text. Interestingly, setting the env var to any value would fix
the issue. For example:

    $ FZF_DEFAULT_OPTS="" gh fzf issue

Shells are weird.
  • Loading branch information
benelan committed May 18, 2024
1 parent ecfd426 commit 5ae01a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gh-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fi

# The following fzf options are shared by all commands. They are prepended to
# the FZF_DEFAULT_OPTS environment variable so they can be overridden by users.
FZF_DEFAULT_OPTS='
export FZF_DEFAULT_OPTS='
--no-hscroll --no-exit-0 --header-lines=1
--preview-window="right,50%,wrap,~2,<60(down,40%,wrap)"
--delimiter=" "
Expand Down

0 comments on commit 5ae01a4

Please sign in to comment.