Subject: bug#59620: 29.0.50; Wrong global-mode-string position in tab-bar + emacs -nw

From: Eli Zaretskii <[email-masked]>
Date: Mon, 28 Nov 2022 14:58:51 +0200

> Cc: [email-masked]
> From: Juri Linkov <[email-masked]>
> Date: Mon, 28 Nov 2022 09:54:17 +0200
> 
> >> Looks like tab-bar-format-align-right is evaluated with the wrong window
> >> being the selected one: it should use the tab-bar pseudo-window to do what
> >> you expect.
> >
> > I don't know what is the root cause, but it's a reasonable hypothesis.
> > Not sure why it only affects "emacs -nw", though.
> >
> > Do you know how to get the tab-bar pseudo-window?  It seems that
> > "f->tab_bar_window" it's not exposed from C to elisp.
> 
> Unless Eli can suggest how to fix `(space :align-to (- right (,hpos)))
> to work on TTY frames the same way as it works on GUI frames,
> I could try to rewrite it to avoid the keyword `right', i.e. to use
> `(space :align-to (,hpos-from-left)) where hpos-from-left could be
> calculated by using string-pixel-width on the text from the left side.

I replied without paying attention to the -nw part, sorry.

On TTY frames the tab bar is not a window, so what I wrote is impossible,
and thus avoiding the 'right' part in the align-to spec is a good idea
regardless.