Giter Club home page Giter Club logo

Comments (3)

lorenzholzbauer avatar lorenzholzbauer commented on June 14, 2024

Same here on Vanilla Emacs. Sadly it is unusable due to this. Has anyone found a way to work around this issue?

from emacs-libvterm.

lorenzholzbauer avatar lorenzholzbauer commented on June 14, 2024

Ok I fixed it on NixOS by using the unstable version of the package

from emacs-libvterm.

KarimAziev avatar KarimAziev commented on June 14, 2024

For those who struggle with this issue, I have fixed it by overriding the original vterm--get-color:

(defun km-vterm--get-color (index &rest args)
  "Retrieve the color by INDEX from `vterm-color-palette'.

A special INDEX of -1 refers to the default colors. ARGS can
optionally include `:underline’ or `:inverse-video’ to indicate
cells with these attributes. If ARGS contains `:foreground',
return the foreground color of the specified face instead of the
background color.

This function addresses an issue where the foreground color in
vterm may match the background color, rendering text invisible."
  (let ((foreground    (member :foreground args))
        (underline     (member :underline args))
        (inverse-video (member :inverse-video args)))
    (let* ((fn (if foreground #'face-foreground #'face-background))
           (base-face
            (cond ((and (>= index 0)
                        (< index 16))
                   (elt vterm-color-palette index))
                  ((and (= index -1) foreground
                        underline)
                   'vterm-color-underline)
                  ((and (= index -1)
                        (not foreground)
                        inverse-video)
                   'vterm-color-inverse-video)
                  ((and (= index -2))
                   'vterm-color-inverse-video))))
      (if base-face
          (funcall fn base-face nil t)
        (if (eq fn 'face-background)
            (face-foreground 'default)
          (face-background 'default))))))

(advice-add 'vterm--get-color :override #'km-vterm--get-color)

This solution works well for my setup, but other users may need to adjust it further based on their specific configuration or themes.

from emacs-libvterm.

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.