-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Duplicate prompt for all cmder/cmd shells (Powerline, etc. as well) #1882
Comments
Also, the new addition of lines 378+ that load all the LUA files in CONFIG with this new behavior: From what I can tell this is not the root cause of this duplication thought and I am still debugging. At first glance, it sure looked like the basically duplicated blocks I just mentioned at end of file lines (lines 378 to EOF) sure looked to me like it could result also in duplication of LUA execution depending on how one's config env variables are set. However, in my case when I tested I obviously had to have |
Okay so I have confirmed my initial thought above was actually correct and is the root cause. This new code block is causing duplicated prompts:
Simply block-commenting this out (for now) resolves all issues. Since this block was just added and never present before, I would ask for clarification as to the reasoning for adding it now and I would be happy to help to come up with a solution for whatever that new need is, but it is clear as-is that it is adding duplicating read behavior that should probably be avoided in any case. |
@CollinChaffin the last two blocks were added in order to load user lua files at the end of processing the Have you edited the The last two blocks are very similar and they are there to support cmder ability to have a shared config I did some testing and it looks like the block you commented is actually unnecessary. Files in this folder are being loaded by clink.lua and then again by clink.exe, I think. I commented it and lua in the Can you point me to how you are adding power line so I can actually test the fix? The ignoring lua files that begin with If we change the ignore prefix I suggest we change it for all cases though. @cmderdev/trusted-contributors any issues with this? |
Also in my testing the ignore code is not working anyway so it could probably just be removed. |
@CollinChaffin - Are you using cmder-powerline-prompt |
No, I have not the block above was added in the last couple commits here and is the cause of the issues. I never edit any lua files outside of the CONFIG folder. Upon upgrading to the last 2 commits (# above), those 2 new blocks appeared in the CLINK.LUA provided HERE in cmder.z. I'll post in a min to show you exactly which commit they first appeared in - but they are the cause - not any edit I've made. Unzipped new cmder.z from here - and broken until I spent hours to figure out why. |
I'm confused the root cause is right there like I said when clink.lua was changed on commit even titled "run user lua afer cmder lua" e69e7f9. Prior to that, the offending code that is causing duplicate loads is NOT there - I just re-confirmed. Obviously, before that commit, user LUAs were ALREADY being loaded correctly from CONFIG folder - I know because we all place our LUAs there to load for years. The issue here is that in adding this offending code commit, you did not remove the prior LUA load code (wherever the heck it is these batch/lua files are driving me nuts) and now you've added a SECOND call to loop through them and load user LUAs. What I'm loading is irrelevant - the code is calling LUA loads twice and since you just said those blocks could be removed, it sounds like maybe you don't know why you added them in that commit? The exact diff is right here showing it was added on Sept 1st: And if you pull repo on commit 0855075 prior to it and unzip clink.lua, the offending blocks are not present. |
Now I can help you easily figure out the best path because I'm guessing you were trying on Sept 1st in those code blocks to better ensure that USER luas were being properly loaded with some exceptions. So, if I pull the repo in July prior to that commit, unzip ONLY that clink.lua and replace the broken one from the Sept 1st commit, the million dollar question is that will greatly help me from having to sit and step through LUA and batch files all day is - all my LUA files in the CONFIG folder EDIT: Forgot to answer not that it matters since this affects much more than just that prompt, but yes, that is cmder-powerline-prompt. |
@CollinChaffin I am not arguing with you, In fact I agree with you 100%. You are not understanding my last post. As I said earlier you found a bug, it happens, but the solution is not to just remove both code blocks. The below explains why: If a user launches The desired effect is load all 'shared/team' config from The code in clink.lua should therefor be:
So that if Notice I also removed the ignore code based on your feedback. Hopefully this makes sense. |
@CollinChaffin PR #1884 submitted please test. |
I have tried #1884 with and without the |
@CollinChaffin Hey just curious does the powerline git aware prompt work for you? It does not seem to for me. EDIT: I got it working, I had another git_prompt.lua that was breaking it. |
I'm so sorry I missed this one I just pulled down the latest from appveyor to re-test and will update shortly! EDIT: I'm late to the game but your #1884 fix I can confirm looks like it did resolve the issue. Thanks so much for getting to it so quickly and I'm sorry if I came across argumentative sometimes I feel I'm not doing the best job of explaining so I tend to then throw too much info in. :) |
@CollinChaffin No probmem. Thanks for the bug report. |
As of the last couple commits, there is a major error in clink.lua that causes all prompts in standard cmd prompts such as powerline etc. to be duplicated as shown here:
This took me hours to track down exactly which file was the cause, through trial and error going back to July's 6f10db0 commmit which I can confirm is the last known good (that I have locally) that does not exhibit this behavior. If you simply use the clink.lua from that commit, the prompts return to normal as shown here:
From diffing that known good and the latest b61c4a2 commit's clink.lua, there are quite a few changes so I'll try in-between things here to narrow it down but wanted to get this posted as I did not see it already and like I said this was a real PITA to suddenly have all cmder prompts doubled and it not be in the build/compile, but in one of the many ancillary support files.
The text was updated successfully, but these errors were encountered: