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

Handle paths with multiple components in chdir #1080

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

tsoutsman
Copy link
Member

Adds support for changing multiple levels of directories at once e.g. cd task/2.

Also since components normalizes the trailing slash, this fixes the bug which prevented changing into a directory followed by a trailing slash e.g. cd namespaces/.

This is indicative of the larger issue that each FsNode implementation needs its own path parsing algorithm e.g. cd task && cd .. doesn't work because TaskFs doesn't support ... I'll have a PR ready soon to fix that issue.

Adds support for changing multiple levels of directories at once e.g.
`cd task/2`.

Also since `components` normalizes the trailing slash, this fixes the bug
which prevented changing into a directory followed by a trailing slash
e.g. `cd namespaces/`.

This is indicative of the larger issue that each `FsNode` implementation
needs its own path parsing algorithm e.g. `cd task && cd ..` doesn't work
because `TaskFs` doesn't support `..`. I'll have a PR ready soon to fix
that issue.

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

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

Thanks!

@kevinaboos kevinaboos merged commit 3a678a9 into theseus-os:theseus_main Dec 12, 2023
3 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 12, 2023
* Adds support for changing multiple levels of directories at once,
  e.g., `cd ./task/2`.

* Also, since `components()` normalizes the trailing slash,
  this fixes the bug which prevented changing into a directory
  followed by a trailing slash, e.g., `cd namespaces/`.

* This is indicative of the larger issue that each `FsNode` implementation
  needs its own path parsing algorithm. For example, the command
  `cd task && cd ..` does not work because `TaskFs` doesn't support
  the notion of a parent directory (`..`). A fix for this is coming soon.

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com> 3a678a9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants