[Bug 254789] Tab completion acts differently in sh than csh when a directory name contains a space

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Apr 5 13:54:41 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254789

            Bug ID: 254789
           Summary: Tab completion acts differently in sh than csh when a
                    directory name contains a space
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs at FreeBSD.org
          Reporter: doctorwhoguy at gmail.com

I first noticed this issue while using FreeBSD 13-RC4. It is still present in
RC5. However because the bug is kind of subtle, it's possible it's been there a
while and I just never noticed it. In any case, the behavior I expect from tab
completion in the terminal is that a tab will complete a filename and enter a
space automatically after the filename, but if tab completion fills out a
directory name, it will put a forward slash after the directory name with no
space. This is useful because an additional tab can be used to fill out
additional elements in a path.

However, I noticed that if a directory name contains a space, a tab will
complete the directory name and automatically put a space at the end with no
forward slash. In other words, it treats a directory name with a space the same
as it treats a filename. This is annoying when trying to use tab to complete a
path name with multiple elements because it requires a backspace and a forward
slash before using tab again.

But this bug only affects regular users and not root. Apparently this is
because regular users use sh by default while root uses csh by default. If I
type "csh" at the command line as a regular user to open a new shell, I get the
expected behavior back. Also, even in sh, if a path name is prepended with
double quotes, a tab will fill in a forward slash and no space at the end even
when a space exists in a directory name. So this is currently the workaround.

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


More information about the freebsd-bugs mailing list