Skip to content

Sway fails to apply multiple pango tags, unless they're surrounded by spaces #7698

Open
@ghost

Description

Please fill out the following:

i3 PR:

This concerns existing i3 functionality.

Description:

In certain cases sway renders pango markup in the binding mode indicator and the status_command output area differently from i3, unless the pango markup is surrounded by spaces.

The problem is that sway renders this incorrect: "<small><b>text</b></small>", and this correct: " <small><b>text</b></small> ". Sway applies the <b> tag but fails to apply the <small> tag, unless the tag is surrounded by spaces. i3 does not do this, it applies both tags, regardless of them being surrounded by spaces or not.

Below I've included examples of this for the mode indicator and status command output, for both sway and i3. Note that only sway fails to apply the small tag, and only when it is not surrounded by spaces. i3 applies it in all cases, as expected.

Screenshots

Binding mode

Sway binding mode indicator, with spaces:

sway-mode-with-spaces

set $wmmode " <small><b>wm: [l]ock [r]estart e[x]it</b></small> "
mode --pango_markup $wmmode {
  ...
}

❌ Sway binding mode indicator, without spaces:

sway-mode-without-spaces

set $wmmode "<small><b>wm: [l]ock [r]estart e[x]it</b></small>"
mode --pango_markup $wmmode {
  ...
}

i3 binding mode indicator, with spaces:

i3-mode-with-spaces

set $wmmode " <small><b>wm: [l]ock [r]estart e[x]it</b></small> "
mode --pango_markup $wmmode {
  ...
}

i3 binding mode indicator, without spaces:

i3-mode-without-spaces

set $wmmode "<small><b>wm: [l]ock [r]estart e[x]it</b></small>"
mode --pango_markup $wmmode {
  ...
}

Status_command output

Sway status_command output, with spaces:

sway-swaybar-with-spaces

time=$(date +"%d %b %H:%M")
echo " <small><b>${time}</b></small> "

❌ Sway status_command output, without spaces:

sway-swaybar-without-spaces

time=$(date +"%d %b %H:%M")
echo "<small><b>${time}</b></small>"

i3 status_command output, with spaces:

i3-i3bar-with-spaces

time=$(date +"%d %b %H:%M")
echo " <small><b>${time}</b></small> "

i3 status_command output, without spaces:

i3-i3bar-without-spaces

time=$(date +"%d %b %H:%M")
echo "<small><b>${time}</b></small>"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    i3-compatSway doesn't match i3's behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions