zbirenbaum / zbirenbaum/copilot.lua

Sqlite jumping up to 100% usage

Open
#688 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dependencies
Dominant language
Lua
Stars
4.1k
Forks
161
Avg merge
11h 54m
Merged PRs (30d)
13

Description

1247972 20 0 11.8G 2368M 82064 R 100.0 1.8 3:21.59 node /.local/share/nvim/lazy/copilot.lua/copilot/js/language-server.js --stdio

my copilot instance is going bananas when running my application in a terminal. I change my terminal names so they match my process I am running something like:

    pcall(vim.api.nvim_buf_set_name, 0, name)

Here is my config:

    {
        "zbirenbaum/copilot.lua",
        cmd = "Copilot",
        event = "InsertEnter",
        config = function()
            require("copilot").setup({
                should_attach = function(_, bufname)
                    if string.match(bufname, "test.term") then
                        return false
                    end

                    return true
                end,
                suggestion = {
                    enabled = true,
                    auto_trigger = true,
                    keymap = {
                        accept = "<C-g>",
                        next = "<C-n>",
                        prev = "<C-p>",
                        dismiss = "<C-\\>",
                    },
                },
                panel = { enabled = false },
                filetypes = {
                    terminal = false,
                    help = false,
                    json = false,
                    gitcommit = true,
                    markdown = true,
                }
            })
        end,
    }

I have the terminal filetype set to false maybe there is a way to set it by buffer type?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the copilot.lua setup shown in the issue, especially should_attach, filetypes, and the terminal buffer handling around vim.api.nvim_buf_set_name. Reproduce the high-CPU behavior with the referenced Copilot language-server process, then verify that terminal buffers do not trigger unwanted Copilot activity and that ordinary buffers still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.