Skip to content

completions: Offer ../ and ./ again#9477

Merged
faho merged 2 commits intofish-shell:masterfrom
faho:fix-dotdot
Jan 16, 2023
Merged

completions: Offer ../ and ./ again#9477
faho merged 2 commits intofish-shell:masterfrom
faho:fix-dotdot

Conversation

@faho
Copy link
Copy Markdown
Member

@faho faho commented Jan 15, 2023

Inadvertently broken in a2d8167, this made cd . no longer offer cd ../ (same for file completions like ls ., which only offers dot-files but not ls ../)

This adds these paths in one specific case rather than changing dir_iter to always go through them. That should be okay.

TODOs:

  • [n/a] Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

Inadvertently broken in a2d8167,
this made `cd .` no longer offer `cd ../` (same for file completions
like `ls .`, which only offers dot-files but no more `ls ../` for `ls ../foo`)

This adds these paths in one specific case rather than changing
dir_iter to always go through them. That should be okay.
@faho faho added the regression Something that used to work, but was broken, especially between releases label Jan 15, 2023
@faho faho added this to the fish 3.6.1 milestone Jan 15, 2023
@ridiculousfish
Copy link
Copy Markdown
Member

Nice find. I think rather than manually inserting these paths, it would be better to have an option in dir_iter_t's constructor which determines whether to skip . and ... That way we are honestly reporting what the filesystem gives us, and call sites will have to consider whether they want . and .. or not.

@ridiculousfish ridiculousfish requested review from krobelus and ridiculousfish and removed request for krobelus January 15, 2023 19:52
Copy link
Copy Markdown
Member

@ridiculousfish ridiculousfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

Copy link
Copy Markdown
Member

@ridiculousfish ridiculousfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@faho faho merged commit 6df09b3 into fish-shell:master Jan 16, 2023
@faho faho deleted the fix-dotdot branch January 16, 2023 09:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

regression Something that used to work, but was broken, especially between releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants