Skip to content
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
Closed

The handling of [ is awkward in general #875

davxiao opened this issue Jun 16, 2013 · 3 comments
Milestone

Comments

@davxiao
Copy link

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
Copy link

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
Copy link
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.

@ridiculousfish
Copy link
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!

haarts pushed a commit to haarts/fish-shell that referenced this issue Nov 1, 2013
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants