-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Errors and failure from bleopt complete_menu_style
#458
Comments
Can you use
To specify the menu-style You can specify the other menu styles in
Use |
Sorry I didn't mention that I had tried this. I do not see the escape characters like this, but the descriptions are still missing:
Thanks for explaining the difference between the two options. I will use Thanks also for the reminder that I should have been using delayed loading. I tried taking that approach, and now I don't get the 'invalid value' or 'not defined' errors mentioned in the first post, but I still have the missing descriptions shown here. I assumed that I am setting it up incorrectly, but I'm not sure, because it seems to work sometimes, but not others. For example: If I type
If I type
I figured it must be 'pilot error' but when I saw this inconsistency, I had second thoughts. Again, my apologies if this is a bad setup on my behalf. |
Ah, OK. That happens when ble.sh fails to extract the descriptions from the man page. The string
$ ls -lt "$_ble_base_cache/complete.mandb/$LANG" | head One possibility is that the man page of
Another possibility is that the format of the man pages is totally different in your system.
|
I think you are on to the problem immediately. The manpages are installed and seem to be working, but the cache seems incomplete:
I notice
|
I first need to clarify that there is no standard format for the man page for defining the options and their descriptions, so one would need to use heuristic matching to the options and their descriptions (to the text or the source of the man page). ble.sh uses a rather conservative approach so that it doesn't pick wrong strings that just look like options and their description. I confirmed that the options cannot be extracted from the man page of For the
Or another possibility is that the distribution (either mine or yours) modifies the man page, so the format for options and descriptions is different.
I confirmed the behavior in my environment, but this seems to be just because the upstream man page provided by |
OK, it seems like we've fixed everything here, and any further bugs are likely all upstream, so thank you for your help! I'm glad to know that my blesh config appears to be behaving as expected now. Looking at fzf, my version is Anyway, I do understand that it won't be possible to parse every option from every app's manpages perfectly. Honestly, I think it's pretty amazing that ble.sh can get the information that it does! I've seen a lot of very fancy bash scripting in my time, but I think ble.sh might take the cake :D Thanks again for all of your help! |
I checked the behavior in Arch Linux where the fzf version is $ type ble/bin/awk As for the |
Thanks for looking into this for me!
If there is anything I can do to help, you got it! |
I added support for the man-page analysis for the |
As for the This should be caused by the combination of missing escaping of hyphens in the upstream |
I imagine that was very obscure and not trivial to find, well done! |
junegunn/fzf#3885 merged in the upstream. |
I pushed a workaround f160b8f in the |
Thanks! |
I was waiting for the upstream sharkdp/bat#2995 to be processed, but there is no activity in the upstream PR after one approval. I gave up waiting for it. Since the problems inherent to |
I asked the upstream about sharkdp/bat#2995, and then it was quickly merged! |
I don't want to annoy you with notifications but this is the third time I wanted to say this today and heart emojis just aren't doing it: Thanks!!!! :) |
Hi @akinomyoga I hope you are well. I have good news today, I have found the cause of many of the failures on my machine. My I do like to have that option there though. I use it when reading normal text files and source code. I wonder if it might be possible to fix this from the ble.sh side? I was thinking, perhaps when calling
eg Force no line numbers:
... Or maybe it could skip the first few characters until the whitespace, or something? |
Thank you for the information. Did you confirm that the above modifications actually fix the problem? Line 4553 in a9b962d
but I doubt this is the problem because $ man -w man
/usr/share/man/ja/man1/man.1.gz
$ LESS=-N man -w man
/usr/share/man/ja/man1/man.1.gz Other parts should be affected by the |
I globally set |
No I'm sorry, I have caused confusion here. I just meant that as an example of what I meant, to call
I'm really sorry! Perhaps I should file a new issue. I thought this might be the same one, but maybe I have a few that are similar but not the same.
It's interesting you mention When I discovered this, I was trying to use journalctl (I have my bash history here). I did the usual ble.sh thing and typed in the command and a trailing - ( I don't know why it 'hit' me then, but I suddenly thought "Hmm when I was looking at manpages yesterday I noticed I have line numbers in them and I didn't like it, I wonder if ble.sh also doesn't like it" so I ran Just in case it's some evil magic combination of my LESS options, I will give you my complete LESS variable (as it was before the fix - this has line numbers forced on):
Thanks for looking into this. I have my fixed LESS variable for now so it is not super urgent for me, but I thought you would like to know the situation here. I hope I haven't caused too much trouble for you. |
Thank you.
Any information would be helpful, but more information is definitely needed to resolve the issue.
$ ble/widget/display-shell-version
$ type ble/complete/mandb/convert-mandoc
$ export LESS='... --LINE-NUMBERS ...' # <-- specify the content of LESS that caused the problem
$ rm -rf "$_ble_base_cache"/complete.mandb # <-- clear the mandb cache
$ less -[TAB] # <-- attempt the completion that caused the problem before
$ export LESS='... --LINE-NUMBERS ...' # <-- specify the content of LESS that caused the problem
$ rm -rf "$_ble_base_cache"/complete.mandb # <-- clear the mandb cache
$ ble/function#advice around ble/complete/mandb/convert-mandoc 'local LESS=; ble/function#advice/do'
$ less -[TAB] # <-- attempt the completion that caused the problem before |
I am quite embarrassed, I can't reproduce this now, even with the exact same LESS variable. Maybe my cache was corrupt, and changing this setting forced it to update? I am certain that removing that option, was the thing that fixed it, but it isn't functioning like that any more, it just works. Anyway, there is obviously no need to change ble.sh to support line numbers with less, it works fine already. I fear I have wasted your time, I'm sorry. Just in case this info is still useful:
|
Never mind. It sometimes happens that a bug disappears after some event. I think |
ble version:
0.4.0-nightly+365101c
Bash version:
5.2.26(1)-release (x86_64-suse-linux)
Trying to set this option, an error is generated, that the function is undefined. But, it is definitely defined in ble.sh, and can be manually executed.
Either ble-reload, or manually entering the bleopt command exactly as it exists in init.sh, the setting is now accepted without error, however the completion descriptions appear broken:
I guess this is some kind of timing issue? Thanks in advance for any help! :)
The text was updated successfully, but these errors were encountered: