You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a certain part of my app, I have a subprocess that needs to stream its output directly to the terminal (vs capturing it and re-printing it via rich console), so before I launch the subprocess, I want to send some color escapes to the terminal.
Without rich, it's easy enough, but I'm already allowing users to customize output colors via env vars, so I can't just do a simple print('\033[2;34m') (for example), since I need to parse the user-provided style for this category of output.
So to summarize: I'm looking for a way in rich to parse a style (with or without some text) and output the ANSI escapes without the closing/reset. Possible?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For a certain part of my app, I have a subprocess that needs to stream its output directly to the terminal (vs capturing it and re-printing it via rich console), so before I launch the subprocess, I want to send some color escapes to the terminal.
Without rich, it's easy enough, but I'm already allowing users to customize output colors via env vars, so I can't just do a simple
print('\033[2;34m')
(for example), since I need to parse the user-provided style for this category of output.So to summarize: I'm looking for a way in rich to parse a style (with or without some text) and output the ANSI escapes without the closing/reset. Possible?
Beta Was this translation helpful? Give feedback.
All reactions