On Mon, Feb 16, 2015 at 12:26:44AM -0600, J Raynor wrote:
> > Yes panes should always have colours. If the pane is set to 8, it uses
> > the window, if the window is 8, it uses the default. It isn't necessary
> > to have a way to set the pane directly to default, we don't have that
> > for any other style - it always follows the hierarchy (like eg the status
> > line options).
> 
> You'd still be following the hierarchy by allowing users to set a
> pane's color to the terminal default.  Note that in this case, the
> word "default" is referring to the terminal emulator's color, the
> actual color used by the terminal emulator window.  It doesn't refer
> to the "default" option that would be set in options-table.c, so you
> aren't bypassing the hierarchy.
> 
> I suppose I just see this as 1 more color.  You can set a pane's bg to
> blue, or colour133, or "terminal default".  Users might like the
> ability to refer to the terminal's default color since the emulator
> isn't limited to the 256 colors that the tty is.  Still against it?

Yes. When the pane background is set to colour 8, it should use the
window background. Only if the window background is set to colour 8 too
should it send an actual default colour \033[49m to the terminal. There
is no need to allow people to set a pane background directly to colour
8. This is how window-status-style etc works, they apply on top of
status-style.

> 
> > No, I think you don't - tty_draw_line draws on screen using tty_cell and
> > that calls tty_attributes. There should be no way to get stuff on screen
> > that doesn't set colours via either tty_reset or tty_attributes. If you
> > change those two, it should be enough.
> 
> You really do.  I have tested this.  The color option doesn't change
> what gets stored in the grid lines, it just changes what gets
> displayed when tmux is going to write a cell that would have been
> written with the terminal's default colors.  Assuming the user didn't
> use setaf/setab, then the colors stored in the grid lines will be 8.
> Yes, tty_draw_line calls tty_cell, and that calls tty_attributes, but
> if you don't fix up the grid_cell returned by grid_view_peek, then the
> grid cell that gets passed to tty_attributes will have fg/bg set to 8.

You don't need to change tty_draw_line IF you change tty_attributes
instead. You WANT the grid cell that gets passed to tty_attributes to
have colour 8. Then tty_attributes knows it wants the pane colour. If
you change tty_attributes, you should never need to change the grid cell
in any caller of tty_attributes, including tty_draw_line.

Colour 8 means whatever the user has set to the pane background, nothing
except tty_attributes and friends should need to know what the actual
colour will be.

We don't have tty_draw_line convert background colour 8 to 0 if the
terminal doesn't support default colours - it is done in tty_colours via
tty_attributes - and it should not do this either.

You may end up actually changing tty_colours, not tty_attributes, but
the point is the same. All the places in your diff where you do:

+       const struct grid_cell  *colgc;
+
+       colgc = get_wp_default_grid_colours(wp);

        tty_reset(tty);
+       if (colgc != NULL)
+               tty_colours(tty, colgc);

You can just change the entire section including tty_reset into:

        tty_attributes(tty, &grid_default_cell, wp);

Or if you do all the work in tty_colours:

        tty_colours(tty, wp);

tty_draw_line will get it for free when tty_attributes does it, because
tty_cell calls tty_attributes. All you will need to do is change it to
pass the wp into tty_cell.

> 
> 
> > We have window options and I'd prefer to use them. Panes are a special
> > case, windows do not need to be.
> 
> I think the active-pane color setting could also be a window option if
> we don't allow a user to specify "terminal default" as a color option,
> as I talked about regarding panes in the first 2 paragraphs of this
> email.  Should it be a window option?  If so, this would change how
> your tty_default_colours function is implemented slightly.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to