GithubHelp home page GithubHelp logo

Comments (7)

zeertzjq avatar zeertzjq commented on June 25, 2024

t_Cs is not supported

from neovim.

Jiyangson avatar Jiyangson commented on June 25, 2024

Is there a way to work around that do the t_Cs thing in neovim? Or what method should I try? change a terminal or something?

from neovim.

zeertzjq avatar zeertzjq commented on June 25, 2024

What terminal are you using? Bash is not a terminal and XTerm doesn't supoort undercurl.

from neovim.

Jiyangson avatar Jiyangson commented on June 25, 2024

I use kitty and it works fine (it shows undercurl as usual). But when I open nvim in a docker container, it has this problem.

from neovim.

zeertzjq avatar zeertzjq commented on June 25, 2024

Hmm, the value of $TERM should be xterm-kitty inside kitty, not xterm.

from neovim.

JCallicoat avatar JCallicoat commented on June 25, 2024

I have the same issue with st 0.9 (with undercurl patch) and tmux next-3.5 built from git head like a week ago. I have TERM=screen-256color inside of tmux (which I need to use for key compatibility with old terminfo databases shipped on servers I administer via ssh). Undercurl works fine outside of tmux (TERM=st-256color) in neovim, but shows only an underline inside tmux.

I have the following overrides in tmux.conf just to ensure the feature is enabled.

set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'  # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'  # underscore colours - needs tmux-3.0

And outside of neovim undercurl is displayed correctly inside of tmux with, e.g., printf '\e[4:3mUndercurl\e[0m\n'. But inside neovim running inside tmux I only get an underline.

I assume there is some kind of feature detection based on the value of TERM? Is there any way to override that to force the feature to be enabled?

from neovim.

Jiyangson avatar Jiyangson commented on June 25, 2024

For anyone who has a similar problem, I asked chatgpt and got a solution. Here is the answer from gpt

When you use docker exec to enter a Docker container, the $TERM environment variable is set to xterm by default because it is a widely recognized and compatible setting for most programs. This environment variable informs programs running on the terminal about the type and capabilities of the terminal so that they can adjust their behavior accordingly, such as how to interpret colors and handle cursor movements.
xterm-kitty is specifically for the Kitty terminal emulator, and Kitty uses it to enable additional features that may not be available in other terminal environments. When you start a Docker container terminal from Kitty, you need to explicitly set the terminal type to retain some of the underlying features of Kitty.
To set the $TERM variable in the container to xterm-kitty, you can pass the environment variable when connecting to the container:

docker exec -it -e TERM=xterm-kitty [container-id] /bin/bash

Note that to fully utilize the features provided by xterm-kitty, your container needs to have the appropriate terminal information files (terminfo). If they are not present, some features specific to xterm-kitty may not work as expected. If the base image of the container does not include the Kitty terminfo file, you may need to copy this file from the host machine to the corresponding location in the container, which is usually /usr/share/terminfo/x/xterm-kitty.

For me, I just copy xterm-kitty in my kitty install path and it works.

docker cp ~/.local/kitty.app/share/terminfo/x/xterm-kitty container_id:/usr/share/terminfo/x/

from neovim.

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.