| Summary: | tcsh execs /bin/ls --color <other options> | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | anand <anand> | ||||
| Component: | misc | Assignee: | Mark Peek <mp> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.2-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-bugs->obrien Over to the tcsh-maintainer in the tree. If the tcsh-developers accept this patch (or another solution), I'm sure David will import a new version of this file soon. Responsible Changed From-To: obrien->freebsd-bugs I'm not the tcsh maintainer any more. Responsible Changed From-To: freebsd-bugs->imp imp == tcsh maintainer. State Changed From-To: open->analyzed Committed through import of tcsh-6.11. Responsible Changed From-To: imp->mp MFC reminder. State Changed From-To: analyzed->closed MFC'd. |
tcsh supports an ls-F builtin that is purported to be faster than the normal /bin/ls. ls-F also supports colorized ls listings and all the normal ls options. When invoked with no arguments, ls-F produces a normal listing like that of /bin/ls. When invoked with arguments, it executes "/bin/ls <args>" where <args> are the arguments passed to ls-F. Colorized output may be enabled by using the command "set color" on tcsh. In this case ls-F <args> translates to "/bin/ls --color <args>". Due to a getopt oddity reported in pr 23148, /bin/ls ignores the --color option and treats the remaining arguments as filenames even if they were options to ls. This causes weird behavior as shown below. Fix: This is a patch that I generated on 4.2 RELEASE. I have sent a modified version of this patch to the tcsh developers. I hope they include it in their next version. Until then, could we have this patch in 4.2-stable please? How-To-Repeat: In an xterm execute the following: 112 wooster:tmp/foo> ls bar baz 113 wooster:tmp/foo> tcsh -f > ls bar baz > ls-F bar baz > ls-F -l total 0 -rw-r--r-- 1 anand wheel 0 Nov 27 17:45 bar -rw-r--r-- 1 anand wheel 0 Nov 27 17:45 baz > set color > ls-F bar baz > ls-F -l ls: -l: No such file or directory > ls-F -a ls: -a: No such file or directory