mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.67k stars 207 forks source link

Weird color output in terminal #1372

Open pcorbineau opened 3 days ago

pcorbineau commented 3 days ago

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 commented 17 hours ago

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 commented 11 hours ago

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 runCMakeDebug 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.