-
Notifications
You must be signed in to change notification settings - Fork 156
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
Antares Prompt Issues: Git Tag Info Missing and Long Paths Crash #701
Comments
@socholo Thank you for reporting the issues, and thank you for including such thorough information! I have a fix coming. |
Re: missing tag indicator -- The coroutine shouldn't be setting |
@socholo P.S. your timing was perfect -- I was about to publish a new update, and I was able to include this before publishing it. |
prompt filter failed: ERROR IN LUA PROMPT FILTER |
@Leezheng1 That's unrelated to issue 701. I've created a new issue 712 where we can discuss what you've reported. |
I really like the recent changes in Clink 1.7.0 to add prompt themes! 😀 I have been using 1.7.3 and the Antares prompt theme to get started and it works well, but I have observed 2 issues that I thought may be worth correcting (I'm happy to submit a PR, if fixing them is worthwhile):
Issue 1: Missing Git Tag Information
When a tag is checked out, the name of the tag is not appearing in the prompt. I find the tag name very useful as tells me where I am - a more significant place than just the Git hash that is dislayed.
From what I could tell, the issue is caused by the
git_status
coroutine and management of the associatedANTARES_GIT_HAS_TAGS
andANTARES_GIT_TAG
variables:clink/clink/app/themes/Antares.clinkprompt
Lines 228 to 243 in 40e09c2
The referenced variables are reset every time the prompt is refreshed - even after the referenced coroutine runs and updates those variables to contain the tag name - thus the tag information is never displayed.
I was able to correct the issue by only clearing the referenced variables when changing to:
Issue 2: Long Paths Cause Crash
When navigating to a directory with a very long path - one that is too long to fit the space available in the prompt - the Antares prompt will truncate the path from the left and replace with ellipses. Unfortunately, there appear to be some logic errors in the code - comparing numbers to booleans - that produces the following output:
From what I could tell, the
pwd_over_half
andgit_over_half
variables are booleans and so should not be checked if> 0
, but just the value:clink/clink/app/themes/Antares.clinkprompt
Line 349 in 40e09c2
After that issue was corrected, I noticed that the
ellipsify()
function has a 2 bugs:k
):clink/clink/app/themes/Antares.clinkprompt
Line 523 in 40e09c2
clink/clink/app/themes/Antares.clinkprompt
Line 547 in 40e09c2
If it would be worthwhile to address these issues, I'd be happy to submit a pull request with the changes that I have made to address them.
Thank you very much - I really appreciate all of the work that you have done on Clink, it's really great!
The text was updated successfully, but these errors were encountered: