Skip to content

bug: When using prompts first time, randomly custom prompts do not go to AI CLI tool #150

@Racle

Description

@Racle

Did you check docs and existing issues?

  • I have read all the sidekick.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of sidekick.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.12.0-dev-1245+g63ece2b151

Operating system/version

Pop_OS 22.04

Describe the bug

When using custom prompts AND opening AI tool for the first time, prompt is added to top of CLI tool instead to its input box.
It doesn't happen all the time, but most of the times.

IF AI Cli tool is already open, it seems to be working just fine.

Steps To Reproduce

  1. Set custom prompts in config + tmux (or use provided repro.lua)

  2. Select prompt

Image
  1. Select CLI tool
Image
  1. Prompt is in wrong place
Image

Same issue with Repro with my config

Image

Expected Behavior

Prompts should go to AI CLI Tool

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro(
  {
    spec = {
      {
        "folke/sidekick.nvim",
        opts = {
          -- add any options here
          cli = {
            mux = {
              backend = "tmux",
              enabled = true
            },
            prompts = {
              commit = "Create one line git commit message\nUse conventional commits.\nCopy it to clipboard.\nUse printf to print message.",
              commit_stashed = "Create one line git commit message for stashed files\nUse conventional commits.\nCopy it to clipboard.\nUse printf to print message.\nif no changes, reply with 'No changes to commit'.",
              security = "Review {file} for security vulnerabilities"
            }
          }
        }
        -- add any other plugins here
      }
    }
  }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions