Open jorgebucaran opened 2 years ago
I ended up taking this for a spin, as it would allow me to move a lot of my out of tree customizations out of Hydro and into my own dotfiles. The only issue I have noticed is that the addons do not work until I move into a git
repository, as $_hydro_addons
is only set in _hydro_prompt
after the check for _hydro_skip_git_prompt
, if I am reading everything correctly.
Yep, should be fixed now! 💯
Thanks, looks good to me!
Would it be possible to turn the existing components to pre-built addons? I would like to display the git branch conditionally. I'm using git worktree and the directory is named after the git branch so it's kinda redundant there.
This feature is awesome nonetheless. Thank you so much for making it.
Having this system merged would be fantastic: I want to create an add-on for myself that displays the host name if any of the SSH_*
vars are set.
Edit: I tested this branch out as well, and it works perfectly for what I want to accomplish:
function _hydro_addon_ssh
if test -n "$SSH_CLIENT"
echo (set_color yellow)🌐:(hostname)(set_color normal)
end
end
set -g hydro_prompt_addons ssh
I think that having this would be fantastic too, but the code required to implement this was non-trivial and my implementation is not great either. The more of these little addons you create the slower your terminal gets.
The more of these little addons you create the slower your terminal gets.
While I love the idea of these, I was also concerned about how they could slow down the terminal.
This runs addons inside a subshell, which is better than nothing, but we'd really want to run each addon in its own subshell.
Addons let you add new components to your Hydro prompt. They're not as flexible as Tide items (and don't intend to be). My goal is not to reinvent Tide, but still allow a degree of configuration not possible right now. For example, maybe I'd want to display the current Node version using nvm.
Creating an addon is easy:
Then in
config.fish
:Closes #34 #35 #36