Skip to content
Discussion options

You must be logged in to vote

Example


image

~/.xonshrc

class LolcatProcessor(@.imp.prompt_toolkit.layout.processors.Processor):
    def apply_transformation(self, ti):
        try:
            n = @.imp.shutil.get_terminal_size().columns
        except:
            n = 100
        line_shift = ti.lineno * 0  # Replace 0 to 5 to have shift per line.
        new_fragments = []
        i = 0
        for style, text in ti.fragments:
            if style and "suggest" in style:
                new_fragments.append((style, text))  # Keep using grey for suggestion.
                continue
            for ch in text:
                hue = ((i + line_shift) / max(n, 1)) % 1.0
                r, g, b = @.imp.colorsys.hsv_to_rg…

Replies: 1 comment

Comment options

anki-code
Jan 14, 2026
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by anki-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
1 participant