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

[Bug]: Also handle directory passed to fish #8258

Closed
thunder-coding opened this issue Aug 29, 2021 · 1 comment
Closed

[Bug]: Also handle directory passed to fish #8258

thunder-coding opened this issue Aug 29, 2021 · 1 comment
Labels
bug Something that's not working as intended
Milestone

Comments

@thunder-coding
Copy link
Contributor

thunder-coding commented Aug 29, 2021

Steps to reproduce

cd $TMPDIR
fish .

Passing any folder/directory to fish results in a infinite loop where fish keeps saying error: Unable to read input file: Is a directory

FLOGF(error, _(L"Unable to read input file: %s"), strerror(err));

This is the file where the problem needs to be solved

What should be done when a directory is passed to fish

Fish should set the current directory to the supplied directory passed through command line

Platforms I confirmed the bug on

  • Android 11 Termux fish 3.3.1
  • Android 7 Termux fish 3.3.1
@faho
Copy link
Member

faho commented Aug 29, 2021

Running fish . means to tell fish to read . as a script file - this runs like fish foo.fish, except instead of foo.fish you've given a directory. That doesn't work, for obvious reasons.

Fish should set the current directory to the supplied directory passed through command line

I disagree. We should simply reject it when a directory is passed as a script file. Otherwise we'd have to introduce another way of running fish - with a file, read the file, with a directory, go to that directory. This is unfamiliar (e.g. bash doesn't do it) and you're, to my knowledge, the first person to try that.

So let's just fix the failure mode.

@faho faho added the bug Something that's not working as intended label Aug 29, 2021
@faho faho closed this as completed in 4c3cb11 Aug 29, 2021
@faho faho added this to the fish 3.4.0 milestone Aug 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants