kdheepak / lazygit.nvim

Plugin for calling lazygit from within neovim.
MIT License
1.31k stars 52 forks source link

Issues related with terminal setting. #133

Open Kang-geophysics opened 2 weeks ago

Kang-geophysics commented 2 weeks ago

Description

To Reproduce I use "Lazy" package manager. I initialized as follows:

vim.opt.shell = 'powershell.exe'

Expected behavior

What is expected to happen:

Screenshots image

If I unset vim.opt.shell , it works well.

I think, lazygit.nvim seems to use termianl related with vim.opt.shell. Thus, I tried to use 'git-bash.'

vim.opt.shell = '"C:/Program Files/Git/bin/bash.exe"'
vim.o.shellcmdflag = "-s"

image

I want to set terminal emulator as git-bash. How can I solve it?

SRCthird commented 1 day ago

I'm having the same issue with vim.opt.shell = 'pwsh' using packer.nvim as my package manager.

SRCthird commented 7 hours ago

This is my current workaround:

  use({
    'kdheepak/lazygit.nvim',
    requires = {
      'nvim-lua/plenary.nvim',
    },
    config = function()
      if SystemOS == "Windows" then -- SystemOS is a dynamic var set in init.lua
        vim.schedule(function()
          vim.api.nvim_create_user_command(
            "LazyGit",
            function()
              local current = vim.opt.shell
              vim.opt.shell='cmd'
              require'lazygit'.lazygit()
              vim.opt.shell=current
            end,
            { force = true }
          )
        end)
      end
    end
  })