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

Ignore color when used in a pipeline #1839

Closed
lamyergeier opened this issue Nov 29, 2023 · 1 comment
Closed

Ignore color when used in a pipeline #1839

lamyergeier opened this issue Nov 29, 2023 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@lamyergeier
Copy link

Diagnostic output

$ jrnl --diagnostic
jrnl: v4.1
Python: 3.11.6 (main, Oct 2 2023, 13:45:54) [GCC 11.4.0]
OS: Linux 6.5.10-300.fc39.x86_64

Current Behavior

 jrnl health --short | fzf --tac --no-sort

image

Expected Behavior

Color should not be used when jrnl is used in a pipeline (this is how grep works)

Repro Steps

Execute the command

Debug output

$ jrnl health --short --debug
[01:09:20] DEBUG Logging start main.py:32
DEBUG Parsed args: main.py:42
Namespace(debug=True, preconfig_cmd=None, postconfig_cmd=None,
filename=None, template=None, on_date=None, today_in_history=False,
month=None, day=None, year=None, start_date=None, end_date=None,
contains=None, strict=False, starred=False, tagged=False,
limit=None, excluded=[], edit=False, delete=False,
change_time=None, export=False, tags=False, short=True,
config_override=[], config_file_path='', text=['health'],
exclude_starred=False, exclude_tagged=False)
DEBUG Reading configuration from file install.py:91
/home/lamy/.config/jrnl/jrnl.yaml
DEBUG Using configuration: install.py:117
"{
'colors': {
'body': 'none',
'date': 'none',
'tags': 'CYAN',
'title': 'BLUE'
},
'default_hour': 9,
'default_minute': 0,
'editor': 'codium --wait',
'encrypt': False,
'highlight': True,
'indent_character': '|',
'journals': {
'test': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Test/T
imeSecondary.txt'
},
'default': {
'display_format': 'markdown',
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Journa
l.txt'
},
'gratitude': {
'display_format': 'markdown',
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Gratit
ude.txt'
},
'food': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Food.t
xt'
},
'health': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Health
.txt'
},
'time': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Time.t
xt'
},
'work': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Work.t
xt'
}
},
'linewrap': 79,
'tagsymbols': '@',
'template': False,
'timeformat': '%Y-%m-%d %H:%M',
'version': 'v4.1'
}"
DEBUG Using journal name: health config.py:206
DEBUG Updating configuration with specific journal overrides: config.py:111
{
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Health.
txt'
}
DEBUG Scoped config: config.py:120
{
'colors': {
'body': 'none',
'date': 'none',
'tags': 'CYAN',
'title': 'BLUE'
},
'default_hour': 9,
'default_minute': 0,
'editor': 'codium --wait',
'encrypt': False,
'highlight': True,
'indent_character': '|',
'journals': {
'test': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Test/Ti
meSecondary.txt'
},
'default': {
'display_format': 'markdown',
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Journal
.txt'
},
'gratitude': {
'display_format': 'markdown',
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Gratitu
de.txt'
},
'food': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Food.tx
t'
},
'health': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Health.
txt'
},
'time': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Time.tx
t'
},
'work': {
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Work.tx
t'
}
},
'linewrap': 79,
'tagsymbols': '@',
'template': False,
'timeformat': '%Y-%m-%d %H:%M',
'version': 'v4.1',
'journal':
'/mnt/Documents/Mobile/Software/Data/Common/Task/Journal/Health.
txt'
}
DEBUG open_journal 'health' Journal.py:473
DEBUG start BaseEncryption.py:16
DEBUG start NoEncryption.py:12
DEBUG decrypting BaseEncryption.py:29
DEBUG decrypting NoEncryption.py:19
DEBUG opened Journal with 2 entries Journal.py:136
DEBUG Search mode: starting controller.py:203
DEBUG Search mode: has search args controller.py:210
DEBUG count: 2 controller.py:253
[01:09:21] DEBUG Printing general summary controller.py:267
┏━━━━━━━━━━━━━━━━━━━┓
┃ 2 entries found ┃
┗━━━━━━━━━━━━━━━━━━━┛
2021-09-23 01:12 @weight 93
2023-11-29 00:43 @weight 100.5

Other Information

No response

@lamyergeier lamyergeier added 🆕 New! bug Something isn't working labels Nov 29, 2023
@micahellison micahellison added duplicate This issue or pull request already exists and removed 🆕 New! labels Dec 23, 2023
@micahellison
Copy link
Member

Closing this as a duplicate since this has already been requested in #1836.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants