Skip to content
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

(bug) Remove ansi escape codes from UI Log Display #600

Merged
merged 1 commit into from
Jul 5, 2024

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

@yohamta yohamta 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!

@yohamta yohamta merged commit fdcc93a into dagu-org:main Jul 5, 2024
3 checks passed
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