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

feat: implement --no-exit #118

Merged
merged 5 commits into from
Sep 30, 2024
Merged

feat: implement --no-exit #118

merged 5 commits into from
Sep 30, 2024

Conversation

wolfv
Copy link
Member

@wolfv wolfv commented Sep 11, 2024

This is what powershell implements and it's quite useful in my opinion.
It allows us to execute a script (after RC files) and then drop into an interactive prompt. For something like pixi shell this is very useful.

@wolfv wolfv changed the title feat: implement --no-exit feat: implement --no-exit Sep 11, 2024
@wolfv
Copy link
Member Author

wolfv commented Sep 11, 2024

@certik would be happy to hear your thoughts. For now, this can work as a custom "RC" file thing (e.g. you could point your shell to shell init-file.sh --no-exit and then have some aliases etc. defined,.

Copy link
Collaborator

@certik certik left a comment

Choose a reason for hiding this comment

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

I think that's fine. Isn't there a more descriptive command line option? I first thought --no-exit will not allow you to exit, which might not be what was intended. :)

@wolfv
Copy link
Member Author

wolfv commented Sep 17, 2024

@certik what do you think about --continue?

@certik
Copy link
Collaborator

certik commented Sep 17, 2024

That's better. Maybe also --interact ? I think the main difference is that shell a.sh executes it and returns. While shell a.sh --interact (or shell a.sh --continue) will open an interactive prompt.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 61.93%. Comparing base (89c4910) to head (9156417).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/shell/src/main.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
- Coverage   62.04%   61.93%   -0.11%     
==========================================
  Files          30       30              
  Lines        2959     2961       +2     
==========================================
- Hits         1836     1834       -2     
- Misses       1123     1127       +4     
Flag Coverage Δ
61.93% <0.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@prsabahrami
Copy link
Collaborator

prsabahrami commented Sep 30, 2024

@wolfv @certik Are you okay with merging this? I think this can be quite useful. Not sure how we can add tests for this. We have to add a tester for the CLI itself as well later.

Copy link
Collaborator

@prsabahrami prsabahrami left a comment

Choose a reason for hiding this comment

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

Used --interact instead of --no-exit.

@wolfv
Copy link
Member Author

wolfv commented Sep 30, 2024

Works for me!

@wolfv wolfv merged commit aa5a6ae into main Sep 30, 2024
7 of 9 checks passed
@wolfv wolfv deleted the no-exit branch September 30, 2024 05:58
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.

3 participants