Skip to content

fzf search: ensure fullscreen with preview on#1630

Open
rolandwalker wants to merge 1 commit intomainfrom
RW/fzf-options-override-environment
Open

fzf search: ensure fullscreen with preview on#1630
rolandwalker wants to merge 1 commit intomainfrom
RW/fzf-options-override-environment

Conversation

@rolandwalker
Copy link
Contributor

Description

fzf search: ensure fullscreen with preview on, overriding environment variable FZF_DEFAULT_OPTS in part.

The mycli documentation describes the fzf search as fullscreen with a preview; these options selectively override parts of FZF_DEFAULT_OPTS from the environment to make sure that is always true.

The user's fzf keybindings, colors, and most other options are still taken from FZF_DEFAULT_OPTS if present.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Feb 25, 2026
@github-actions
Copy link

Findings

  1. Potential compatibility regression if fzf version doesn’t recognize --no-height or --preview-window ...:nohidden. This will cause the search to fail with “unknown option” on older fzf builds. Consider checking fzf --version or probing fzf --help once and conditionally including these flags, or provide a fallback that omits them. File: mycli/packages/toolkit/fzf.py:51

Missing tests / edge cases

  1. No test coverage for option construction. A small unit test around search_history’s fzf_opts could assert that --no-height and --preview-window=down:wrap:nohidden are included, and that existing options remain unchanged. File: mycli/packages/toolkit/fzf.py:48

If you want, I can draft a minimal test that validates the options list without invoking fzf.

overriding environment variable FZF_DEFAULT_OPTS in part.

The mycli documentation describes the fzf search as fullscreen with a
preview; these options selectively override parts of FZF_DEFAULT_OPTS
from the environment to make sure that is always true.

The user's fzf keybindings, colors, and most other options are still
taken from FZF_DEFAULT_OPTS if present.
@rolandwalker rolandwalker force-pushed the RW/fzf-options-override-environment branch from 4d673f3 to b4be456 Compare February 26, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant