argos icon indicating copy to clipboard operation
argos copied to clipboard

ANSI colors not showing (when escape is first character on line)

Open lingo opened this issue 1 year ago • 1 comments

Given this script

#!/bin/bash

echo -e "Testing ansi\n---"

echo -e "\e[36mFirst char is escape, color doesn't work | ansi=true emojize=false unescape=false trim=false useMarkup=false"
echo -e "\e\e[36mDouble esc char renders strangely | ansi=true emojize=false unescape=false trim=false useMarkup=false"
echo -e " \e[36ma space as first char; works| ansi=true emojize=false unescape=false trim=false useMarkup=false"
echo -e "​\e[36ma zero-width space as first char; works | ansi=true emojize=false unescape=false trim=false useMarkup=false"

I get the following results on Gnome Shell 42.9 with Argos master branch (I changed metadata.json to allow this to run on my Gnome version)

image

If this is a problem with my Gnome version, I understand it's not supported. However, I thought I'd report this in case it's a bug in Argos ANSI handling.

lingo avatar Jun 28 '24 15:06 lingo

The same happens when using the <span color="yellow">Foo</span> syntax.

I also came up with using a zero-width space as the first character to work around this. The space may also be written as &#8203; to make it more "visible" in the script.

patrickbergner avatar Mar 07 '25 17:03 patrickbergner

I discovered this is actually a bug in mutter, not in argos.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1324

lingo avatar Aug 30 '25 19:08 lingo

Re-opened as it shows the workaround

lingo avatar Aug 30 '25 20:08 lingo