Git Product home page Git Product logo

Comments (4)

micahellison avatar micahellison commented on May 25, 2024

Hi @aisneto, based on that log, it looks like the color codes in the output from jrnl --short might be messing with your next call to jrnl, or the other commands in your piped chain. It's sending a bunch of color codes and a tag to your final jrnl -on call:

on_date='\x1b[1m\x1b[30m2022-11-16 09:45:00 AM\x1b[0m \x1b[1m\x1b[33m@phil\x1b[0m'

If you first pipe its output to a color remover like ansi2txt before processing the output, does that help? You'll need to strip out that tag (@phil) also.

from jrnl.

aisneto avatar aisneto commented on May 25, 2024

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.

from jrnl.

micahellison avatar micahellison commented on May 25, 2024

Hi @aisneto, I think the issue that your script is clearing the formatting with aha at the end when instead it'd be better off clearing the formatting at the beginning, before shuf and cut work on it, like so:

jrnl -on "$(jrnl --short | aha --black | shuf -n 1 | cut -d' ' -f1)"

from jrnl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.