-
-
Notifications
You must be signed in to change notification settings - Fork 972
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
Git States #337
Git States #337
Conversation
The |
Hi, and thanks for the PR. I would suggest splitting this up in separate PR's so each topic of change can be discussed in separation. Here are my initial thoughts:
How much of a speed improvement is this, did you perform any benchmarks? Also, I believe this change might open us up to a security hole that can e.g. be triggered by njhartwell/pw3nage, but I haven't tested the PR. Can you confirm if this is an issue or not?
This is a backwards-incompatible change, anyone relying on the environment variable would be affected. Although setting the prompt manually is possible, it's not very intuitive or obvious. It might even break in future, or new features might be missing.
Colors is something we're actively considering, however, we would like to avoid introducing new environment variables. This is currently being discussed in #256 and #306 (also #292). It would be great if we could see a PR for a
I'm not sure we want to go down this path with Pure, personally I don't see much value in showing that something is staged or untracked since an indicator is not granular enough. I use
Hmm, I think the reason this option exists (IIRC) is to speed up dirty checking for large repos (think chromium). Can you confirm @sindresorhus? PS. We use tab-indentation instead of spaces in Pure, I would recommend installing the |
Yup |
And I agree with everything @mafredri said. |
I am working on a rewrite BrandonRoehl/zsh-clean
The |
I didn't get a clear answer regarding pw3nage, so I tried it out myself and this PR is indeed vulnerable to it. Expanding the git branch name in-place, as in this PR, is not safe. Original: PR:
Do you have any facts to back this up? I would think that variable lookups are so cheap that it's not worth thinking about (at this scale). |
I've never heard of this, could you point me to some resource or provide background?
I'd also be interested to learn more of this, e.g. why would it be faster to use psvar? Do you know any resources? |
https://www.zsh.org/mla/users/2005/msg00863.html Big O
pre render This is the pre command trace Where as if you assign prompt only once then all you have are variable lookups it could be just
psvarpsvar can also test the existence of variables in prompt its own way too using |
I'm not unfamiliar with PS. I don't see how Big-O has anything to do with this. We're not really expressing the complexity of algorithms here, just a few assignments ;-). |
4 major changes
prompt_pure_preprompt_render
not passing expressions to thePROMPT
PROMPT
anyways*
.
+
respectivelyPURE_GIT_UNTRACKED_DIRTY
removed in favor of displaying the.
My Config for 256bit colors