[Bug 270452] sh: filename completion hides last line

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 25 Mar 2023 21:07:32 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270452

            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

FreeBSD 13.2-STABLE GENERIC amd64

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
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz<TAB>
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0 
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1
$ 0123456789012345678901234567890123456789
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz

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.