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

PTK support for custom themes #3920

Merged
merged 11 commits into from
Oct 26, 2020
Merged

PTK support for custom themes #3920

merged 11 commits into from
Oct 26, 2020

Conversation

dyuri
Copy link
Contributor

@dyuri dyuri commented Oct 22, 2020

Added support for changing PTK specific styles (non-pygments related, like autosuggest or the completion-menu) via the new custom styles (#3878).

Using this I took the opportunity to "merge" PTK_STYLE (I think it was ptk1 related, so we don't need it anyway) and PTK2_STYLE into DEFAULT_STYLE_DICT and replace $PTK_STYLE_OVERRIDES with a more generic $XONSH_STYLE_OVERRIDES.
(As a next step after #2861, I'd be happy if you could take a look @laloch .)

Example how to change background color for completion menu to dark mode:

$XONSH_STYLE_OVERRIDES['completion-menu'] = 'bg:#333333 #EEEEEE'

image

@dyuri
Copy link
Contributor Author

dyuri commented Oct 22, 2020

Sorry, checking the tests.

xonsh/environ.py Outdated Show resolved Hide resolved
Token.PTK.CompletionMenu.Completion.Current: "bg:ansibrightblack ansiwhite",
Token.PTK.Scrollbar.Arrow: "bg:ansiblack ansiwhite bold",
Token.PTK.Scrollbar.Background: "bg:ansibrightblack",
Token.PTK.Scrollbar.Button: "bg:ansiblack",
Copy link
Member

Choose a reason for hiding this comment

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

I think these will then need to be added to all styles.

Copy link
Contributor Author

@dyuri dyuri Oct 23, 2020

Choose a reason for hiding this comment

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

They should be there due to the change in pyghooks where I've replaced the old PTK_STYLE with DEFAULT_STYLE_DICT in the style chainmap.

@dyuri dyuri marked this pull request as draft October 23, 2020 06:26
@dyuri dyuri marked this pull request as ready for review October 23, 2020 15:57
Copy link
Member

@laloch laloch left a comment

Choose a reason for hiding this comment

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

LGTM

@dyuri dyuri requested a review from scopatz October 25, 2020 16:28
@scopatz
Copy link
Member

scopatz commented Oct 26, 2020

Thanks @dyuri!

@dyuri dyuri deleted the ptk_support_for_themes branch October 26, 2020 14:52
@scopatz
Copy link
Member

scopatz commented Oct 26, 2020

Hmm This seemed to change the $PROMPT color rendering for me on PTK. FWIW my $XONSH_COLOR_STYLE = "monokai". Now the prompt now looks like it has more default colors.

@dyuri
Copy link
Contributor Author

dyuri commented Oct 26, 2020

That's strange, I use monokai as well and have not discovered anything (but my PROMPT is rendered by powerline), gonna take a look.

@laloch
Copy link
Member

laloch commented Oct 26, 2020

This also made $XONSH_STYLE_OVERRIDES["bottom-toolbar"] = "noreverse" crash the shell completely, because

  • reverse/noreverse are not supported
  • there's no validation

@laloch
Copy link
Member

laloch commented Oct 26, 2020

I use monokai with powerline and my prompt colors are broken too.

@scopatz
Copy link
Member

scopatz commented Oct 26, 2020

Should we revert for the moment?

@dyuri
Copy link
Contributor Author

dyuri commented Oct 26, 2020

Yep, please, I'll take a look.

@dyuri dyuri restored the ptk_support_for_themes branch October 26, 2020 15:29
@dyuri
Copy link
Contributor Author

dyuri commented Oct 26, 2020

This is strange indeed:
image

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.

3 participants