Skip to content

SIXEL: cursor positioning and shared palette in TEs #22

@jerch

Description

@jerch

(Partially offtopic for VT340, where the palette is always a globally shared one...)

I wonder if we manage to get a somewhat consistent behavior for TEs implementing sixels for these aspects:

  • cursor positioning
    Imho the final cursor positioning after sixels is a wild-grown nightmare among TEs currently, where most modes makes not much sense or can be achieved by additional cursor movements. Thus I'd like to discuss, if we can simplify that to 2 basic modes, that are hard to achieve otherwise:
    • text cursor at VT340 position: Make this the default mode. Its big advantage is the fact, that it can dump sixels up to the last line without doing another scroll. Furthermore it places the cursor at image offset, which has a big advantage for aligned text output.
    • cursor at last image cell: I see this as the most natural cursor behavior in terms of cursor advance, if one sees sixel input as a block of cells. This is similar to what xterm and mintty do, but they go one cell further and the nightmare starts - what, if the cursor ends at COLS+1? Should the cursor wrap? Based on which setting? DECAWM? I'd say no, imho no wrapping should happen at all, instead place the text cursor in the last image cell. From there app can move the cursor. This mode has the advantage to automatically give information about the printout size in both image dimensions. If we dont allow any automatic wrapping, the flaw of xterm's mode with the last line scrolling also vanishes.
  • private vs. shared palette handling
    This one is not really VT340 related, as the palette is always shared. What I'd like to discuss here, is the question, how newer TEs could possibly handle private and shared in a uniform way.
    • private palette
      I'd like to propose, that this mode always bootstraps the initial palette from some predefined palette, an app user can expect to work with without any own color definition (we currently use VT340-color for that, I am also fine to use ANSI256 if we can agree on that).
    • shared palette
      This mode is really tricky for most newer TEs, as many underlying sixel libs dont expose indexed images, but realize colors immediately (I call this printer mode here). I still hesitate to implement a true terminal-wide shared palette handling, but would do that, if there is demand. In the meantime I'd like to propose a less disruptive shared mode instead, which still works in printer mode with immediate coloring, but carries the created palette forward to the next incoming sixel image. This would allow to lower data pressure by omitting palette creation in consecutive images using color definitions from an earlier image.

I am not really determined to the modes as proposed above, but I think we should find an agreement to these aspects, so app devs have a model expected to work in a certain way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions