fzf icon indicating copy to clipboard operation
fzf copied to clipboard

fzf border not visible on Linux TTY

Open Zocker1999NET opened this issue 2 months ago • 8 comments

Checklist

  • [x] I have read through the manual page (man fzf)
  • [x] I have searched through the existing issues
  • [x] For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.65.2

OS

  • [x] Linux
  • [ ] macOS
  • [ ] Windows
  • [ ] Etc.

Shell

  • [x] bash
  • [ ] zsh
  • [ ] fish

Problem / Steps to reproduce

When launching fzf on a Linux TTY with TERM=linux, fzf seems not capable of drawing a border around the list of files.

I can reproduce this by:

  • booting into a Linux system
  • jump to a TTY or not boot into a desktop manager
  • run fzf --margin=1 --border=rounded
  • see missing border (sometimes "replaced" by the characters which were drawn at the same positions before)

Screenshot of a qemu VM (but I can also reproduce this on actual hardware):

Image

Zocker1999NET avatar Oct 11 '25 07:10 Zocker1999NET

I would try two things

  1. See if --no-unicode helps.
  2. Build the latest binary from the source and check if it fixes the problem. (see 2a92c7d792b45112ab82eef0be2aa11038e6185d)

junegunn avatar Oct 11 '25 10:10 junegunn

$ fzf --version 0.65.2 (ab407c46)

$ uname -r 6.12.51_1

I couldn't reproduce the issue. I can see the straight border lines, but not the rounded corners ╭╮╰╯. However, I can see the sharp border corners with --border sharp (┌┐└┘). And --no-unicode works as expected, falling back to ASCII borders just like in desktop environments.

fsc0 avatar Oct 11 '25 11:10 fsc0

  • FYI: I’m also running Linux 6.12.51.
  • adding --no-unicode does not change anything, the output still looks the same
  • When building the newest commit (ab407c46) with Nix, it at least shows an actual border, but the corners do not look rounded compared to executed in a desktop environment: Image But also visible in that screenshot is that the margin does not get cleared for some reason (see lower left corner).

Zocker1999NET avatar Oct 11 '25 12:10 Zocker1999NET

  • adding --no-unicode does not change anything, the output still looks the same

What was your command with --no-unicode option? Cause when I used below command on my TTY, --no-unicode works as expected.

fzf --no-unicode --margin 1 --border rounded

But also visible in that screenshot is that the margin does not get cleared for some reason (see lower left corner).

I also confirm this margin issue happens.

fsc0 avatar Oct 11 '25 13:10 fsc0

I do not remember, but I now used yours and got the same result:

Image

with fzf 0.65.2 as provided by nixpkgs (just in case of a typo, this shows the fzf I ran above from history):

Image

Zocker1999NET avatar Oct 11 '25 13:10 Zocker1999NET

I see, since we're testing this issue almost same condition, except I'm using Void Linux and you are using NixOS. I'm just wondering how other major distros handle this issue.

fsc0 avatar Oct 11 '25 13:10 fsc0

Why are you using $TERM=linux? This is for non-gui use. You should be using: xterm (16-colors) or xterm-256color.

What does curl wttr.in show you?

eabase avatar Oct 24 '25 16:10 eabase

Why are you using $TERM=linux? This is for non-gui use.

This is the default on NixOS when being on a TTY (i.e. I have not configured this myself). I would say that this is non-gui.

You should be using: xterm (16-colors) or xterm-256color.

Interestingly, when setting xterm explicitly, I see no borders (but also no invalid characters on its place instead). And when setting xterm-256color explicitly, the borders looks as expected.

What does curl wttr.in show you?

The output is colorful and horizontal & vertical arrows are rendered correctly. Only diagonal arrows seem not be rendered correctly.

(I tested this all on a real machine now because I was not able to quickly spin up a VM, hence I cannot provide good screenshots.)

Zocker1999NET avatar Oct 27 '25 09:10 Zocker1999NET