8000 prompt_pwd: Allow keeping some directory components at full length by faho · Pull Request #8208 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

prompt_pwd: Allow keeping some directory components at full length#8208

Merged
faho merged 4 commits intofish-shell:masterfrom
faho:prompt-pwd-full-dirs
Aug 9, 2021
Merged

prompt_pwd: Allow keeping some directory components at full length#8208
faho merged 4 commits intofish-shell:masterfrom
faho:prompt-pwd-full-dirs

Conversation

@faho
Copy link
Member
@faho faho commented Aug 5, 2021

Description

This allows specifying to prompt_pwd that 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/-D option.

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/-d option 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:

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

faho added 4 commits August 5, 2021 18:50
And allow passing the parameters as options.
This allows us to test it without cd-ing about the place.
@faho faho added this to the fish 3.4.0 milestone Aug 5, 2021
@ridiculousfish
Copy link
Member

Seems reasonable to me. Nice test!

@faho faho merged commit b10d64e into fish-shell:master Aug 9, 2021
@faho faho deleted the prompt-pwd-full-dirs branch August 9, 2021 15:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0