-
Notifications
You must be signed in to change notification settings - Fork 38
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
Easier "Initialization" #46
Comments
Thanks for the suggestion! This seems like a reasonable idea, especially if it is a requirement to get However, I like that the current setup is explicit: it's pretty easy to understand what I would also like to avoid having a separate config file for now. |
That makes sense. I wasn't suggesting a separate configuration file (maybe that should be split into a separate PR?), but I feel like it might be worth change the wrappers to be embedded in the client itself. For example, take a look at the listed bash/zsh wrapper: tere() {
local result=$(/path/to/tere "$@")
[ -n "$result" ] && cd -- "$result"
} As it stands, I have a few problems with this wrapper:
In my opinion, these four reasons support implementing something like Also, like I've said, I would be happy to put in the work to implement this feature myself and to submit a PR. |
@superatomic The config file would be required to retain functionality though, as there would no longer be a way to specify custom options. Looking at e.g. zoxide this could also be solved using templating though, and the options could be the ones specified along the initial "call" to But a config file might still be the better choice as it benefits future implementations of e.g. a config gui to be more newbie appealing. It could also allow auto installation of the shell scripts, similar to how broot does it(again avoiding someone uncomfortable with rc files to have to modify them). I'd also be happy to implement it, as i am quite bored at the moment and have done similar before :) Edit: Spelling |
Couldn't shell aliases just be used? That, or any options provided to I don't believe a configuration file is required for this to work. |
Ok, but if we let users alias tere before the init function we pretty much blow up the purpose of the whole init thing. The inlining could be done using a template engine(e.g. tiny-template) Im not sure if a Config GUI is planned but that feature totally requires a config file. |
Okay, so instead of aliases it could just be part of tere() {
local result=$(/usr/local/bin/tere --mouse=on --folders-only "$@")
[ -n "$result" ] && cd -- "$result"
} This would solve needing to use aliases. |
As this case is relatively simple a A config file would not be required for the init function but could be required in the future, making it wise to implement it now as it is one of the possible solutions to this problem as well. Edit: My answer sounded way too passive aggressive, Clarification |
I see your point. If @mgunyho is okay with a configuration file (TOML, possibly?) I would be happy to implement that along with the Luckily, the feature for a configuration file could always be added later and be fully backwards compatible if |
Yes, backwards compatibility would be given. But both the config file and the inlining of options kind of serve the same purpose: The user would still be able to configure tere, even though the actual invocation of it would be hidden away behind Also I think that something like (broot's)[https://github.com/Canop/broot] auto-installation would be quite useful for command line newbies. This would then also require some kind of config GUI as having users edit an rc file would be just as "hard" as editing a config file. |
Do we want to split these off into separate issues? Even if both of them get implemented, they can both be implemented in any order, and neither depend on each other. Basically, the issues are:
Not only would the second issue take more work, it might also come later or not at all (see @mgunyho's comments), although I do support it. I think it would be more productive to discuss these improvements separately. |
Yeah you're right the config file doesnt belong here. What I meant to say is that their purpose overlaps, yet one is not as flexible as the other. So why not implement only one? Also the config file is basically done by deriving e.g. serde's |
That's actually a lot simpler than I though it was going to be. I think you're right: all that needs to be done is to choose a file format (I vote TOML via toml-rs, but anything works), to add a few lines of code to load the configuration file, and to derive Of course, your idea for a TUI interface to the configuration file is a bit more complex. I'd recommend that you open a separate issue and link to this issue as previous discussion, and then edit this issue to only discuss adding |
Sorry for the delayed response. I did a (not very exhaustive or extensive) scan through some similar terminal apps to see how they handle this. They seem to roughly fall in to three categories:
There doesn't seem to be a clear consensus on which is the best way. Here are some thoughts I have related to the one-liner proposal.
Admittedly, these are mostly minor edge cases but I still would like to avoid creating them. Sorry if I sound like I'm just arguing for the sake of it, I'm just a bit on the fence with this. It doesn't feel like the benefits would clearly outweigh the extra complexity and possibilities for bugs. |
One option could be to just try to implement it and see how well it works, but we should be prepared to discard that work if I'm not happy with it. |
I like the idea of using
I don't believe anything like this would have to be done for
The one-liner could accept an alias parameter to change the name of the command. The provided name would default to eval "$(tere init --alias t)" |
Don't worry about it! It's completely fair to be concerned about whether changes like this are worth doing (and if so, exactly how they should be implemented). |
This is fair. But note how we are now adding more complication. Imagine the reverse situation, that the recommended way would be to have |
Something like
source "$(tere --init shell)"
similar to how starship does it? This could be nice to declutter one's bashrc(or whatever)? Would require either templating(see zoxide) or a config file though, since one could no longer configure the arguments otherwise... I'd be willing to implement both the printing, and either of the configuration solutions but am I overengineering this?The text was updated successfully, but these errors were encountered: