New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The handling of [ is awkward in general #875

Closed
davxiao opened this Issue Jun 16, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@davxiao

davxiao commented Jun 16, 2013

On IRC dhs227 notes:

If I press F1 it generate [[A, then press enter. fish complains fish: Tokenizer error: “Unexpected end of string, parenthesis do not match”
the problems are: a) it complain twice.
b) it does not clear the cmd line, which I think it should be.
c) in this case,fish likely "eats" the latest cmd line somehow.

Obfuscate also notes that:
That seems like a bug. The handling of [ is awkward in general as well: [[ errors, [[ errors, [[ is an ordinary token, as is [[.

Above all are reproduced on 20130606 build.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jun 16, 2013

I'm personally in favour of dropping [ as a builtin entirely and just using test because it's more orthogonal, unless there happens to be a difference of which I'm unaware.

ghost commented Jun 16, 2013

I'm personally in favour of dropping [ as a builtin entirely and just using test because it's more orthogonal, unless there happens to be a difference of which I'm unaware.

@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Jun 16, 2013

Member

There is a real command [ (that is, there really is a file with path /bin/[), so I think fish needs to treat [ as a command.

The "parenthesis do not match" seems like a tokenizer error. Square brackets should only be treated specially after variables.

Member

ridiculousfish commented Jun 16, 2013

There is a real command [ (that is, there really is a file with path /bin/[), so I think fish needs to treat [ as a command.

The "parenthesis do not match" seems like a tokenizer error. Square brackets should only be treated specially after variables.

@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Sep 11, 2013

Member

I've changed my mind about square brackets only being treated specially after variables. I don't think that's a good idea any more. This commit should improve the error message and ensure it is only reported once:

46452e7

Thanks for reporting this!

Member

ridiculousfish commented Sep 11, 2013

I've changed my mind about square brackets only being treated specially after variables. I don't think that's a good idea any more. This commit should improve the error message and ensure it is only reported once:

46452e7

Thanks for reporting this!

haarts pushed a commit to haarts/fish-shell that referenced this issue Nov 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment