Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird color output in terminal #1372

Closed
pcorbineau opened this issue Nov 25, 2024 · 3 comments
Closed

Weird color output in terminal #1372

pcorbineau opened this issue Nov 25, 2024 · 3 comments

Comments

@pcorbineau
Copy link

pcorbineau commented Nov 25, 2024

Debug adapter definition and debug configuration

Running on Windows 11, with Windows terminal.

nvim-dap 4.4ms 󰢱 dap.utils  mason-nvim-dap.nvim
        dir    C:/Users/pcorbineau/AppData/Local/nvim-data/lazy/nvim-dap
        url    https://github.com/mfussenegger/nvim-dap
        branch master
        commit 8517126
# nvim --version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

I use default dap config to reproduce and use mason nvim dap with this config :

return {
    "jay-babu/mason-nvim-dap.nvim",
    dependencies = {
        "williamboman/mason.nvim",
    },
    opts = {
        ensure_installed = { "codelldb" },
        automatic_install = true,
        handlers = {
            function(config)
                require("mason-nvim-dap").default_setup(config)
            end,
            codelldb = function(config)
                config.adapter = {
                    type = "server",
                    port = "${port}",
                    host = "127.0.0.1",
                    executable = {
                        command = "codelldb",
                        args = {
                            "--port",
                            "${port}",
                            "--settings",
                            vim.json.encode {
                                showDisassembly = "never",
                            },
                        },
                    },
                }
                require("mason-nvim-dap").default_setup(config)
            end
        },
    },
}

Debug adapter version

v1.10.0

Steps to Reproduce

Basically launch dap debug

Expected Result

expected result obtain using :terminal command and launching target manually without debugger :
term

Actual Result

I got background color on every colorscheme (I test habamax, catppuccin, tokyonight, onedark, ...) in the terminal output :
dap-debug
As you can see above, the text is literally unreadable.

@mfussenegger
Copy link
Owner

mfussenegger commented Nov 28, 2024

What happens if you run the command directly but from within :term ?

The reproduction steps are incomplete - would need that test runner/app that produces the output you're getting.

@pcorbineau
Copy link
Author

What happens if you run the command directly but from within :term ?

If I run my executable directly with next command for example. I got no color issue inside a the terminal.
:term build\Debug\tests\lib-gtest.exe

The reproduction steps are incomplete - would need that test runner/app that produces the output you're getting.

Sorry I' m quite new to neovim env.
I have a small sandbox project to test c++ test framework gtest, catch2 and doctest. I use Civitasv/cmake-tools.nvim to run CMakeGenerate, CMakeBuild. I usually run CMakeDebug to automatically attach to dap my current target run ( instead of having to hand-type the path to executable to dap). As mentioned above, I use codelldb with common settings to debug cpp code. Does the bug come from codelldb, which gives nvimdap weird colors?
I don't think issue comes from Civitasv/cmake-tools.nvim cause I can run CMakeRun (without dap attach) and got no color issue in term.

@pcorbineau
Copy link
Author

Ok after more investigation, I try with other c++ dap adapter : cpptools. Got same issue. At this point, I was pretty sure it comes from nvim-dap.

But later, I tested the codelldb extension on vscode to gave a look about this error. And the issue is also on vscode 😨 . But not with cppvsdbg (un adapated cpptools for windows). So I will open a ticket on codelldb porject to check if anyone got this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants