Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zph
Copy link
Contributor

@zph zph commented Jul 5, 2024

Reason: Ansi escape codes are intended to manipulate a terminal and when they're printed they make it more difficult to read the intended log content.

Current output:
image

Desired output as represented by PR:
image

Task definition:

steps:
  - name: step1
    command: bash $HOME/src/dagu/tester.sh
# tester.sh
#!/usr/bin/env bash

set -eou pipefail

source $HOME/bin/lib/colors

echo -e "${gre}green text, ${mag}magenta text, ${coloroff}default"
echo -e "${gre}green text, ${mag}magenta text, ${coloroff}default"
echo -e "${gre}green text, ${mag}magenta text, ${coloroff}default"
echo -e "${gre}green text, ${mag}magenta text, ${coloroff}default"
echo -e "${gre}green text, ${mag}magenta text, ${coloroff}default"
echo -e "${gre}green text, ${mag}magenta text, ${coloroff}default"
....

$HOME/lib/colors is: https://github.com/zph/dotfiles/blob/master/home/bin/lib/colors with a number of ansii escape codes for injecting color into terminal text.

This will also manifest with terminal based progress bars which use escape codes to refresh the screen's display or move to start of line.

Thanks for reviewing this and let me know if you'd like adjustments or clarification.

Ansi escape codes are intended to manipulate a terminal and when they're
printed they make it more difficult to read the intended log content.
Copy link
Collaborator

@yottahmd yottahmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨✨LGTM✨✨, thanks a lot!

@yottahmd yottahmd merged commit fdcc93a into dagu-org:main Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants