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: truncate prompt current_directory and title to keep last components #337

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

edouard-lopez
Copy link
Member

@edouard-lopez edouard-lopez commented Dec 18, 2023

related: fixes #336

How to test pre-release?

☠️ Feature can be unstable and break your prompt!

fisher install pure-fish/pure@feat/truncate-directory-path # branch name
set --universal pure_enable_foo_feature true

First contribution?

Check the 👍 Contribute section and the contributing guide.

Specs

New config in conf.d/pure.fish

set --universal pure_truncate_prompt_current_directory_keeps 2
set --universal pure_truncate_window_title_current_directory_keeps 2

Documentation

Usage

set --universal pure_truncate_prompt_current_directory_keeps 2
❯ set --universal pure_truncate_window_title_current_directory_keeps 2

Acceptance Checks

  • documentation is up-to-date:
  • feature flag is present in conf.d/pure.fish ;
  • [ ] symbol is present in conf.d/pure.fish ;
  • tests are passing (I can help you 🤗 ): 🔴
  • customization is available ;
  • [] feature is implemented.

@edouard-lopez
Copy link
Member Author

Todo:

-ge 1
      ^
~/.config/fish/pure/tests/../functions/_pure_parse_directory.fish (line 14): 
    if test $pure_truncate_prompt_current_directory_keeps -ge 1
       ^
in function '_pure_parse_directory' with arguments '9'
	called on line 1 of file ~/.config/fish/pure/tests/../functions/_pure_prompt_current_folder.fish
in command substitution
	called on line 7 of file ~/.config/fish/pure/tests/../functions/_pure_prompt_current_folder.fish
in function '_pure_prompt_current_folder' with arguments '10'
	called on line 1 of file ~/.config/fish/pure/tests/_pure_prompt_current_folder.test.fish
in command substitution
	called on line 8 of file ~/.config/fish/pure/tests/_pure_prompt_current_folder.test.fish
in command substitution
	called on line 23 of file ~/.config/fish/pure/tests/_pure_prompt_current_folder.test.fish

@edouard-lopez edouard-lopez self-assigned this Jan 23, 2024
@edouard-lopez edouard-lopez added the 🚀 enhancement performance, UX or maintainability label Jan 23, 2024
@edouard-lopez edouard-lopez force-pushed the feat/truncate-directory-path branch 2 times, most recently from 74cdc58 to c468c90 Compare January 23, 2024 10:47
@edouard-lopez edouard-lopez merged commit a4e6b25 into master Jan 23, 2024
6 checks passed
@edouard-lopez edouard-lopez deleted the feat/truncate-directory-path branch January 23, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement performance, UX or maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there any option in pure like truncation_length in starship? I want it to show last three parent folder.
1 participant