how to duplicate the color in shellsession? #3301
-
I am trying to replicate it using prismjs. I use tomorrow-night as theme and v1.26.0 and added plugins line-number, line-highlight, and commandline
this is my code snippet
This is how it looks like As you can see, the web_1 | is greyed. How do I make it orange color as well? I have seen this #2849 not sure if there's a specific token to set specific shell colors for output |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The problem with terminal output is that it doesn't follow any structure. Any program can output anything it wants, so there is nothing for Prism to highlight. Sure, we as clever humans can see some structure, but it's still very much unstructured text. The only reason you get some color in the terminal is that the program does the highlighting itself. The easiest solution might be to manually highlight those parts. You can use Keep Markup to keep existing markup. <pre class="command-line lang-shellsession" data-user="alice" data-host="localhost"
data-output="2-5"><code>docker-compose -f local.yml up
<span class="special-class">web_1 |</span> Going to use psycopg2 to connect to postgres
<span class="special-class">web_1 |</span> Op error: SCRAM authentication requires libpq version 10 or above
<span class="special-class">web_1 |</span>
<span class="special-class">web_1 |</span> Waiting for PostgreSQL to become available...</code></pre> Just change |
Beta Was this translation helpful? Give feedback.
The problem with terminal output is that it doesn't follow any structure. Any program can output anything it wants, so there is nothing for Prism to highlight. Sure, we as clever humans can see some structure, but it's still very much unstructured text. The only reason you get some color in the terminal is that the program does the highlighting itself.
The easiest solution might be to manually highlight those parts. You can use Keep Markup to keep existing markup.