[Bug 270452] sh: filename completion hides last line

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 25 Mar 2023 21:07:32 UTC

            Bug ID: 270452
           Summary: sh: filename completion hides last line
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: naddy@FreeBSD.org


Under specific circumstances, sh(1)'s interactive filename completion fails to
show the last line of possible completions. script(1) shows that the missing
line is written to the terminal, but then cleared and overprinted by the next
prompt. I don't know if the bug is in sh(1) or editline(3).

How to reproduce in a standard 80-column terminal:

Create long filenames:

$ touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0
$ touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1
$ touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz2

Write a sufficiently long dummy command for the line to wrap and hit TAB to be
offered possible completions:

$ 0123456789012345678901234567890123456789
$ 0123456789012345678901234567890123456789

After the list of completions is displayed, the prompt with the incomplete
command is shown again. Note that list of possible completions lacks the final
*2 file.

You are receiving this mail because:
You are the assignee for the bug.