A very minor problem (something works that shouldn't), but nevertheless:
Example: when I typed by mistake ``ls | t ail`` (note the space),
fish silently changed into my `~/t/` directory (which I happened to
have).
It should have colored the ``ail`` in red and shouted at me when I executed it.
Turns out that an explicit ``cd t ail`` also succeeds, silently
ignoring the extra argument. Although here the syntax highlight does
show the ``ail`` in red.
I wanted to fix it myself and send a patch but I became a bit lost in
the flow :-(
- Implicit cd is recognized in `parse.c` in `parse_job()` around line 1990.
However, at this point only the first word has been put into `args`
from the tokenizer.
The general flow of the function is quite complex, so I gave up on
fixing it here.
- Explicit cd is implemented in `builtin.c` in `builtin_cd()` around line 2570.
This looked easy but when I run it, it received only the first
argument (even after `functions -e cd`, see below).
I tried to track down with gdb who eats the extra arguments but
didn't achieve much progress and again gave up.
- I did notice that in the default `./share/functions/cd.fish`, line
25 says ``builtin cd $argv[1]`` and there are no checks for length of
argv.
Small experimentation shows that this function is called with the
full arguments both by implicit and explicit cd. So a check here
would be effective, and very easy to implement. However:
- This would not solve the lack of red syntax hightlight for
implicit cd with extra arguments.
- This would not work if somebody removes/replaces the `cd`
function, or directly invokes ``builtin cd foo bar``.
Ideally, the builin itself should get all the argument and shout
if there are too many. Although if hard to do, this is not really
important.
So it will have to wait for somebody well familiar with the code
(Axel?) to fix properly...
--
Beni Cherniavsky <[EMAIL PROTECTED]> (I read email only on weekends)
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users