-
Notifications
You must be signed in to change notification settings - Fork 13
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
Remove shell rc eval step #12
Comments
Hi acrisci, As far as I know, there is no way to change the working directory without using the shell built-in command Jay |
I didn't think of that. It turns out you are correct. There is another way that might be a bit cleaner though. You can also change directories by cd $1 I can do cd $(/usr/bin/dtags-chdir.py $1) Where The benefit of that would be that you could put all your logic in the python script to avoid repeating your logic in many different places. It also has the benefit of simplifying the instructions to telling people to put this in their shellrc file: alias d="source /usr/bin/dtags-chdir.sh" for every shell (including the ones you don't support now). Backwards compatability could be achieved by evaling that alias when This is just a thought on how to make things easier. If you like things the way they are, that's fine :). |
First of all thanks a lot for all your input. I really appreciate it. I have considered what you are suggesting (a shell function/script piggybacking on a python executable) in the past, and you are right it definitely has its advantages. The only thing I didn't like about the approach was the fact the python interpreter would be invoked every single time. I've actually tested both methods and as small as it may be, I noticed a small difference in speed (especially on slow VMs). I decided to sacrifice a little bit of convenience during set up in exchange for better overall performance. In fact, in the future I may leave Python altogether and convert the whole tool into a set of shell functions for this very reason. |
That is actually a good point. Every milisecond counts when running a command like There can be a solution to that, however, that you should consider before you ditch python. It is possible to compile the python files so that they load faster. You should see a big difference in startup times. Whether or not that's good enough I'll leave up to you. |
The conversion will probably take a lot research and time to carry out. So it won't happen any time soon, if at all. I've never considered .pyo files. I will try it out when I have time. Thanks! |
I believe this project would be much more user friendly and easier to maintain if we could somehow get rid of the step that requires users to add
command -v dtags > /dev/null 2>&1 && eval "
dtags shell zsh"
to their shell rc. The alternative would be to add an executable ford
into the PATH instead of relying upon an alias.This seems to be a deliberate design decision on your part so I assume you did it for a reason. Could you please explain your thought process behind this decision?
If i went through the code more carefully and found a way to accomplish this without the eval step, would you consider a PR for this feature?
The text was updated successfully, but these errors were encountered: