Skip to content

Support light and dark terminals for Ion syntax highlighting#218

Merged
jobarr-amzn merged 1 commit into
amazon-ion:mainfrom
popematt:color
May 20, 2026
Merged

Support light and dark terminals for Ion syntax highlighting#218
jobarr-amzn merged 1 commit into
amazon-ion:mainfrom
popematt:color

Conversation

@popematt
Copy link
Copy Markdown
Contributor

Issue #, if available:

N/A

Description of changes:

Follow-up to #201 to make it ready to be released.

  • Support both light and dark terminals
  • Change the non-color flag to --no-color.
  • Change flag semantics to be "last one wins"
  • Remove color flags from ion inspect. (Syntect highlighting is not compatible with the ion inspect output. It takes ages to produce the output, and it's garbled.)
    • Also changed the name to with_syntax_highlighting() to make this less likely to get confused in the future.
  • Incidental: update the .gitignore file

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment thread src/bin/ion/output.rs
Comment on lines +43 to +49
let light_mode = terminal_light::luma().is_ok_and(|luma| luma > 0.6);
let theme_name = if light_mode {
"Monokai Extended Light"
} else {
"Monokai Extended"
};
let theme = assets.get_theme(theme_name).clone();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@jobarr-amzn jobarr-amzn merged commit cc4cb7a into amazon-ion:main May 20, 2026
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