GithubHelp home page GithubHelp logo

Custom palette support about kmscon HOT 4 CLOSED

aetf avatar aetf commented on August 26, 2024
Custom palette support

from kmscon.

Comments (4)

viccie30 avatar viccie30 commented on August 26, 2024 1

Libtsm definitely has the necessary bits to enable a custom palette from kmscon.conf. It nearly has everything to support the Linux code as well, except for one bit.

libtsm rightfully expects every OSC sequence to end with either '\x07' or '\9C' (https://github.com/Aetf/libtsm/blob/4faef1e0a04b54eefbd2245abeea197a702e2086/src/tsm/tsm-vte.c#L2335-L2338). https://man7.org/linux/man-pages/man4/console_codes.4.html calls out an issue with the Linux palette set and reset sequences: they don't need to end on ST ('\x9C'). Like xterm, libtsm would mishandle these sequences without special treatment. Is this something you'd want added to libtsm in some way? Or just not support this and just set palettes from the configuration file?

The other issue is related to the Linux palette reset sequence. Except for a custom palette, there is no way for kmscon to reset the palette to the defaults for a built-in libtsm palette. Either kmscon should be able to query the current palette or the default palette from libtsm, or the whole machinery should be added to libtsm after all.

from kmscon.

viccie30 avatar viccie30 commented on August 26, 2024

I don't know if you've already worked on this, but I would like to have a go at this if not.

My personal idea would be to do both: allow a default custom palette in kmscon.conf and allow changing on the fly through escape codes. I think that would have to be implemented on the side of libtsm then?

from kmscon.

Aetf avatar Aetf commented on August 26, 2024

Feel free to take this 😄

libtsm already has the necessary bits for both. There's tsm_vte_set_osc_cb that can be set from kmscon to handle any OSC sequences. The gtktsm example uses it to handle title changes. kmscon can call tsm_vte_set_custom_palette during the OSC callback to change colors.

from kmscon.

Aetf avatar Aetf commented on August 26, 2024

Let's forget about it then. Setting a custom palette from the config file should be good enough for most use cases.

from kmscon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.