Rolv-Apneseth / starship.yazi

Starship prompt plugin for yazi
MIT License
38 stars 0 forks source link

Disable prompt character #8

Open PoisonFrog opened 3 months ago

PoisonFrog commented 3 months ago

Is it possible to make starship.yazi disable the character module without using a whole new configuration file that has it disabled? I just don't want to see the prompt icon ("❯") at the top.

Rolv-Apneseth commented 3 months ago

Hmm - I'll have a look but I'm not sure. Of course if it was on 2 lines it would just be cut off but I understand some prefer to keep it on one line.

I know you can do starship toggle character, but the user needs to have the disabled line in their config, and it feels wrong to be messing with the user config.

Maybe starship module character, measure the length of that and cut it off the end of the string. I'll look into it when I have some time for this

Rolv-Apneseth commented 3 months ago

Yeah not sure how to do this, I think some kind of toggle needs to be added to starship first. I tried the second approach I mentioned but it seems there are some inconsistencies in the length of the prompt icon so as far as I can tell that doesn't seem to work reliably.

I see a couple of the config options in starship have detect_env_vars which could potentially be helpful if it existed for character.

I'll leave this open in case there are any updates to starship, or if anyone else wants to try tackle this, my attempt is on this branch.

PoisonFrog commented 3 months ago

I see. Do you think it would be possible to make the config_file property accept a relative path? This would at least make the plugin configuration more portable when using a custom config.

Rolv-Apneseth commented 3 months ago

The issue is it's not running in a shell so it doesn't expand ~ and $HOME. I can however implement a manual conversion of those in the given path to the actual home directory by fetching the OS variable $HOME separate. Does seem a bit jank though, what do you think?

PoisonFrog commented 3 months ago

Does seem a bit jank though, what do you think?

I'm not very technical. If it is a janky solution then maybe you should pass on it, after all this is just an inconvenience and not a breaking bug or anything like that.

Rolv-Apneseth commented 3 months ago

No worries. I'll just implement it cause I don't think it's too bad

Rolv-Apneseth commented 3 months ago

There you are, #9 is merged so you should be able to use ~ or $HOME, let me know if it works for you

PoisonFrog commented 3 months ago

There you are, #9 is merged so you should be able to use ~ or $HOME, let me know if it works for you

Yes, it is relative paths are working now! Thank you!