-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Strange behavior for the "-on" flag #1843
Comments
Hi @aisneto, based on that log, it looks like the color codes in the output from
If you first pipe its output to a color remover like |
I've tried your recommendation using "aha", like this: jrnl -on "$(jrnl --short | shuf -n 1 | cut -d' ' -f1 | aha --black)" Now I got it working. However, strangely enough, some tries did return "no entries". Still, I would say that the command this way works 9 of 10 times. |
Hi @aisneto, I think the issue that your script is clearing the formatting with
|
I'm closing this to clear off my list, though feel free to tag me with a comment back here if you need any more help. |
Diagnostic output
jrnl: v4.1
Python: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
OS: Linux 6.1.0-17-amd64
Current Behavior
I'm attempting to retrieve all entries from a randomly chosen day using a combination of commands. This should be easily achieved with the command:
jrnl -on "$(jrnl --short | shuf -n 1 | cut -d' ' -f1)"
. However, my journal indicates that no entries were found. Interestingly, when I use echo"$(jrnl --short | shuf -n 1 | cut -d' ' -f1)"
, I receive the expected result for a day where there were indeed entries in my journal (e.g.,2023-11-24
).Here's where it gets perplexing. If I manually use the result prompted by that echo as an argument for the
-on
flag(e.g., jrnl -on 2023-11-24
), I successfully retrieve entries. Additionally, if I use another flag, such asjrnl -from "$(jrnl --short | shuf -n 1 | cut -d' ' -f1)
", I also retrieve entries correctly. It appears that the-on
flag is encountering difficulties when directly reading the output."Even more perplexing is that the command sometimes works, promptly retrieving all entries on a random day. I do not have a clue what is happening.
Expected Behavior
The retrieval of all entries on a random day
Repro Steps
Simply try to use the output from other bash code with the -on flag.
Debug output
Other Information
No response
The text was updated successfully, but these errors were encountered: