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

Update cd command to use correct path traversal from the path crate to allow for parent directory #1104

Merged
merged 16 commits into from
Sep 9, 2024

Conversation

nnh12
Copy link
Contributor

@nnh12 nnh12 commented Aug 28, 2024

This pull request adds the option to navigate to the parent directory respective of the current working directory, without specifying the full path. The cd .. is a standard operation in linux. For example, if current directory is /extra_files/test_files, running cd .. moves directory to /extra_files.

Below are some test cases ran on Theseus:

/extra_files/test_files: cd ..
task[20] existed with code 0 (0x0)
/extra_files: 
/extra_files: cd ..
task [21] exited with code 0 (0x0)
/: 
/extra_files/test_files/text: cd ..
task[28] exited with code 0 (0x0)
/extra_files/test_files:

The default cd operation still works too:

/extra_files/test_files/: cd text
task[29] exited with code 0 (0x0)
/extra_files/test_files/text: 

@nnh12 nnh12 changed the title Add cd .. option to allow user to switch to parent directory Update cd command to use correct path traversal from the path crate to allow for .. Sep 6, 2024
@nnh12 nnh12 changed the title Update cd command to use correct path traversal from the path crate to allow for .. Update cd command to use correct path traversal from the path crate to allow for parent directory Sep 6, 2024
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, looks great now!

@kevinaboos kevinaboos merged commit ee7688f into theseus-os:theseus_main Sep 9, 2024
3 checks passed
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