Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: show flags (filter, etc.) by default #20

Merged
merged 2 commits into from
Feb 15, 2025
Merged

Conversation

Rolv-Apneseth
Copy link
Owner

Fixes #19

This will by default show the flags, such as filter, find etc., right after the starship prompt.

I've also added setup options to either move the flags to before the starship prompt, or just disable them entirely.

This solution won't work by default with starship themes which are meant to take up the full width of the terminal, so either disable it entirely, ignore it (you won't see it anyway) or, if it is acceptable, allow it to show before the prompt, which will cut off the right side of your prompt when showing flags.

@Rolv-Apneseth
Copy link
Owner Author

@blackdaemon, would you mind testing out if this works alright for you? If you have time, the setup options too. Otherwise, don't worry, I'll just merge and hope if works for everyone

@blackdaemon
Copy link

@Rolv-Apneseth It works but it does not cooperate with the tabs properly. I disabled all other plugins to be sure.
scenario:

  1. in tab 1 I go to git dir to see rich starship
  2. in tab 2 I go to a different dir (also git repo)
  3. I search and then filter, filters are properly displayed at the end of starship line
  4. I switch back to tab 1, now I see correct files, no filter, but the header shows directory and starship from tab 2

@blackdaemon
Copy link

I think it's maybe unrelated to your latest changes, should I try with master branch?

@blackdaemon
Copy link

Tried on main branch, this problem does not relate to your latest changes and is present on main. New issue should be opened for this.
Regarding filters, it works well, shall I try some specific scenarios? My starship setup is default, 2 lines, so I can see properly first line without the prompt character.

@Rolv-Apneseth
Copy link
Owner Author

Could you also give me yazi --version? I followed the steps you listed and I can't recreate the issue.

@blackdaemon
Copy link

Reagring measuring the length of the starship line, I did something similar in python and go and I strip the ansi characters using known regular expression and then get the length of the string which is then just bare character count.

@blackdaemon
Copy link

blackdaemon commented Feb 15, 2025

My yazi version is:
Yazi 25.2.11 (38e45c64 2025-02-15)

Installed as:
cargo install --locked --git https://github.com/sxyazi/yazi.git#b9416d8a041849b0bc8d5790e9934b8b5a762a80 yazi-fm yazi-cli

@Rolv-Apneseth
Copy link
Owner Author

Regarding filters, it works well, shall I try some specific scenarios? My starship setup is default, 2 lines, so I can see properly first line without the prompt character.

You can if you want, but I'd say people with problems specific to their config can just open a new issue.

Reagring measuring the length of the starship line, I did something similar in python and go and I strip the ansi characters using known regular expression and then get the length of the string which is then just bare character count.

Feel free to have a go at it if you want. Trimming the correct number of characters to fit the flags is not so simple.

Yazi 25.2.11

I'll see if there's been changes to the tab event. You're saying switching tabs doesn't update the starship prompt right?

@blackdaemon
Copy link

Yes, switching to new tab and back keeps the last tab info.

@Rolv-Apneseth
Copy link
Owner Author

Anyway, seems this is OK to merge for now. Thanks for testing it out!

I'll open a new issue for the tab thing.

@Rolv-Apneseth Rolv-Apneseth merged commit f6939fb into main Feb 15, 2025
1 check passed
@Rolv-Apneseth Rolv-Apneseth deleted the header_fix branch February 15, 2025 17:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter/search info not visible in header
2 participants