prompt_pwd: Allow keeping some directory components at full length#8208
Merged
faho merged 4 commits intofish-shell:masterfrom Aug 9, 2021
Merged
prompt_pwd: Allow keeping some directory components at full length#8208faho merged 4 commits intofish-shell:masterfrom
faho merged 4 commits intofish-shell:masterfrom
Conversation
And allow passing the parameters as options.
This allows us to test it without cd-ing about the place.
Alternative is to print an error.
Member
|
Seems reasonable to me. Nice test! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This allows specifying to
prompt_pwdthat you'd like to keep the last N components at full length instead of shortening them.This can be done either by setting $fish_prompt_pwd_full_dirs to the number, or passing the new
--full-length-dirs/-Doption.The rationale for that is that the earlier path components are typically slower changing and known - it's often something like ~/dev/. So by keeping these short, more space can be kept for the components at the end that are more important and faster changing.
Similarly, instead of setting
$fish_prompt_pwd_dir_length, this adds a--dir-length/-doption for symmetry, and allows passing the directory so that we can better test this. Options are probably the much nicer interface here anyway.(we have had someone open a PR about this years ago, which I rejected. I'm afraid I was wrong, sorry!)
TODOs: