-
-
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
[tealdeer 1.61] the tldr completion produces errors and a few questions #451
Comments
tldr cache issue
Thanks for the report. I tried to reproduce the problem, but so far I cannot reproduce the problem. The
$ cp ~/.bash_history ~/.bash_history.backup # please back up your command history if needed
$ INPUTRC=/dev/null bash --norc --noprofile # <-- start a child session of plain Bash without any configuration
$ source /path/to/ble.sh --norc
$ tldr xxxx
# <-- Does the problem reproduce?
I actually suspect this would be related to the problem with Another mystery is that as far as I search the shown error message, nothing is found in the entire project of tldr on GitHub. In addition, nothing seems to be found on the internet. Hiding edit markers of the form
|
Re: tldr cache issue
I suspect what you use is not https://github.com/tldr-pages/tldr/ but https://github.com/dbrgn/tealdeer because I found the error message in the video in the codebase of However, I still cannot reproduce the problem with the tealdeer version of
but the error message is not repeated and the command execution just terminates without any problems. Another thing that I noticed is that the error message is still slightly different; there is an extra word "Warning: " at the beginning in my environment. Maybe the version of Could you provide the version of your $ tldr --version
I tried it in my terminal, xterm, and screen, but the problem doesn't arise in any terminals in my environment. |
Hello @akinomyoga First of all thank you for you detailed explanations. Q1
The problem does NOT reproduce with this steps. This will likely indicate that the problem is, around my configuration. I modified too much the ble.sh default configs. I will detail in this in a few lines. Q2: I was suspecting some kind of binding. I thought of vim-like because i have read in some issues that those are somewhat integrated in ble.sh , but i think i may be wrong about this, since you said they are in vi-editing mode. Hiding edit markers of the form...
Disabling autosuggestion based on syntax and programmable completions Yes, this seems what i wanted, thank you!!!!
I was doing some tests meanwhile doing this comment, and i found that the problem would be likely in my
As you can see, i adapted the Disable Features section and i was doing some commenting in there to see what i like to keep. Another small detail: Before this (a few hours ago) i discovered that if i wrote |
Thank you for your replies.
OK!
This seems to be the same as mine, which I built from the source today.
Hmm, if the error is not present when you restore the ble.sh settings, that suggests that those ble.sh settings are unrelated. I also think these shouldn't affect the behavior of external programs. In fact, I tried your ble.sh settings now, but the problem doesn't arise with I suspect you have changed another part of your system since you last reproduced the problem. For example, did you run diff --git a/src/config.rs b/src/config.rs
index 98d4e46..7cd896f 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -14,7 +14,7 @@ use yansi::{Color, Style};
use crate::types::PathSource;
pub const CONFIG_FILE_NAME: &str = "config.toml";
-pub const MAX_CACHE_AGE: Duration = Duration::from_secs(2_592_000); // 30 days
+pub const MAX_CACHE_AGE: Duration = Duration::from_secs(60); // 1 minute
const DEFAULT_UPDATE_INTERVAL_HOURS: u64 = MAX_CACHE_AGE.as_secs() / 3600; // 30 days
fn default_underline() -> bool { and install this modified version. |
No, strangely it works all of sudden. I have not updated the cache, just because it would make this not reproducible anymore:
I also have not ran any kind of system updates. It seems to work in my 2 installed terminals, so i would discard something about the terminals (qterminal and Xterm). |
Thank you for keeping your cache for the testing purpose. So there should be any other part that has been changed. One possibility is that the ble.sh settings you had were actually different from the current one, but I think there are even other factors that might affect the behavior. I'd like to ask about the detailed behavior in the video. I see some stray characters are inserted at the beginning of the error messages, which reads
Do you have an idea about what these are? Maybe are they what you've input through your keyboard? I've been thinking until now that those are random strings produced by a single call of I was also wondering why the header
This implies that when the error is happening, Note: the above message says 40 days, but I'm now testing the possibility that the problem only happens at a specific day count by modifying the source code of tealdear. However, I still cannot reproduce the problem. |
Ah, wait. I think I now understand what happened. So in the video, you haven't actually run the If that's the case, it should be related to a completion setting for the Do you have a file I guess you had the code to load bash-completion in the previous setting (such as |
Those are my keyboard inputs. When i started to typing, the warning message about the cache update started to appear, 1 time per letter. The keys i press were random, they are not an actual valid string (like
Indeed, that was what happened, but the strangest part was that the error was not reproduced if the string was already stored in the history file (the first
I dont think that would be the case. Because i reported this a 3 days ago and it was happening to me just 2 hours ago (during the answer to your reply). So it should be day-independent.
In other words, because the ENTER key was not pressed, right? Could be all this be caused by some kind of incomplete removal? Because of the following: I installed the blesh package first, and then i discovered that some functions are not in the 0.3 and that it would be easier to me to use the blesh-git package instead (the ble-faces were easier with git since all issues were using the devel version). What i do not recall was if i removed it and then installed the Another thing was that the first time of using
But this should have affected me just a few hours, since i changed that line for the devel suggested ones (present in a previous comment, in where i added my ble-sh About your new comment, i have the I also have Update: I also tried this:
And this DOES reproduce the issue! But i as i said, adding |
I tried the current version of the tealdear completion, but the problem doesn't reproduce. I also checked older versions of the Then, I next suspected that a completion setting for a different I guess you had a completion setting for a different
Thanks for the confirmation!
This is also consistent with the current hypothesis that the completion settings had caused the problem. The auto-complete feature is involved here. The Also, do you still have the line
Ah, yes. I was thinking you've run the command by pressing ENTER key, so I was trying to reproduce the problem by pressing ENTER key, where stdout is connected to TTY and the form of the error message is different.
The incomplete removal of
You don't have to remove the previous version (unless the used AUR helper is broken). blesh-git/PKGBUILD specifies
I now think it should also be related to the line
Could you provide the content of that file? Also what is the result of the following command? $ complete -p tldr |
Ah, great! Then, I want to examine the content of your |
Yes, of course:
I instaled
Indeed, commenting that line in my Update The seems to be a difference between my tldr completion and the one you have shared in a URL:
|
Thanks! and yes, I could reproduce the error message:
Ah, OK. The completion setting is dynamically loaded, so it's not initialized until the completion is attempted. You could run
Yeah, that's expected. The command
Yeah, your tldr completion seems to be still provided by tealder, though the version seems to be older. |
Digging a bit deeper, i have found that the If i do the So this could be some kind of issue with tealdeer, indeed. The link you have provided has a file which has been modified 1 month ago, so maybe there was a possible change that fixes this. But this change has not arrived to archlinux packages,yes Update So i did this: I replaced the content of And i can verify that the program now behaves correctly! I think a temporary solution, for those users having this issue, is to do that change in the tldr file located in completions folder, until the tealdeer package is updated at archlinux/ or other distribution.
Does work too, no issues after the change |
OK, the minimal reproducer of the error message is this: $ tldr -l >/dev/null
The cache hasn't been updated for 40 days.
You should probably run `tldr --update` soon. The up-to-date version of the completion setting suppresses the error message by specifying |
I found the corresponding PR in the upstream tealdeer: tealdeer-rs/tealdeer#327, though the content of the error message seems to have been different from ours. The reporter had experienced the error message for a different reason, i.e., the missing cache. |
I think this one could be closed, since as you have tagged, its an external issue. Thank you very much for you help!!! |
I think you can switch to AUR (en) - tealdeer-git. Or maybe you could request a new release of tealdeer referencing the issue fixed by tealdeer-rs/tealdeer#327, but I'm not sure what would be their policy for the release. |
I'm closing. Thanks! |
ble version:
0.4.0-devel4+b72d78a9
Bash version:
5.2.26(1)-release (x86_64-pc-linux-gnu)
Hello, i started to use ble.sh because it allwos me to see my history commands without open the history file. I removed some features which i was not interested to use but i still struggle with a few things:
I use a command called
tldr
(https://github.com/tldr-pages/tldr/) which shows concise information about how to use a program, for example:tldr pacman
will show the basic and most used commands for the pacman package manager.This command works properly in pure bash and in zsh for example, but when i installed ble.sh (
0.4.0-devel4+b72d78a9
) i end up with a bug or some kind of glitch that i dont know how to solve. I will attach a short video showing what is happening.xterm-blesh.mp4
It happens to me with my default terminal (qterminal) but it also happens in Xterm.
I suspect this is related to some kind of vim or the sort hotkey, which i would like to remove if you can tell me how (to avoid conflicts with normal bash usage).
Keep in mind that the shown message that is repeated only is shown by tldr after the command is executed (is some kind of warning) and is shown only one time per tldr execution.
In the other hand, i would like to remove the
ble: something
status messages that appear in the terminal from time to time. I think this is not related to the main issue of this ticket but i don't know how to do it.I also dont know how to do the following: i like the feature that shows the history-based commands, but i would like to only keep that part, and not the 'smart' part that says me the name of a file starting with the letters i am writing.
For example: I write:
ffmpeg -i d
and i get a suggestion in my $HOME dir with a file which starts with a "d". I dont know how this is called and if its possible, but sometimes interferes with the history-based suggestions (that i like to keep). I only would like to keep the 'i writeffmpeg -i d
and when i press TAB i will see any possible file that starts wid the "d".I really appreciate the program you have made, i disabled most functions because i dont use them but please dont take it personal, i imagine a lot of people find them useful.
PS: If the video does not play, download it. For some reason i am unable to see it in firefox, i had to download it.
The video shows a continious "spam" of the tldr warning. This message appears when i am writing letters.
PS2: The
tldr pacman
command and every other saved in the history shows properly. It only happens for those i dont save. If i runtldr cat
,even with the glitch, and then i open a new terminal and i writetldr cat
, the issue does not happen with that commandThe text was updated successfully, but these errors were encountered: