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

C-Enter in prompt will not submit #170

Closed
ljseng opened this issue Apr 25, 2023 · 13 comments
Closed

C-Enter in prompt will not submit #170

ljseng opened this issue Apr 25, 2023 · 13 comments

Comments

@ljseng
Copy link

ljseng commented Apr 25, 2023

C-Enter in prompt will not submit. It will enter a new line in the prompt.

I am using Packer as my plugin manager.

    -- chatgpt
    use {
        'jackMort/ChatGPT.nvim',
        config = function() require("chatgpt").setup() end,
        requires = {
            "MunifTanjim/nui.nvim",
            "nvim-lua/plenary.nvim",
            "nvim-telescope/telescope.nvim"
        }
    }

below is list of plugin i use.
ChatGPT.nvim
LuaSnip
aerial.nvim
barbar.nvim
cmp-nvim-lsp
cmp_luasnip
everforest
friendly-snippets
gitsigns.nvim
lualine.nvim
marks.nvim
mason-lspconfig.nvim
mason.nvim
nui.nvim
nvim-autopairs
nvim-cmp
nvim-comment
nvim-lspconfig
nvim-notify
nvim-tree.lua
nvim-treesitter
nvim-web-devicons
nvim_context_vt
packer.nvim
plenary.nvim
telescope.nvim
toggleterm.nvim
trouble.nvim

i am using ShellGPT and it is working my zsh. thus, pretty sure my token is valid. just not sure why C-Enter is not submitting the prompt.

image

@PGimenez
Copy link

same here with lazy, I just installed and C-Enter doesn't submit

@comiluv
Copy link
Contributor

comiluv commented Apr 25, 2023

What's the OS and terminal do you use?

@ljseng
Copy link
Author

ljseng commented Apr 25, 2023 via email

@ZacxDev
Copy link

ZacxDev commented Apr 25, 2023

i am also facing this issue, remapping the submit key also doesn't seem to work unless I am doing something wrong.

"jackMort/ChatGPT.nvim",
  config = function()
    require("chatgpt").setup({
      chat = {
        prompt_input = {
          submit = "<C-g>"
        }
      }
    })
  end,
  requires = {
    "MunifTanjim/nui.nvim",
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim"
  }
})

@comiluv
Copy link
Contributor

comiluv commented Apr 25, 2023

Windows Terminal has trouble entering some key combinations. See microsoft/terminal#530 (comment)

@PGimenez
Copy link

I'm on OS X using iTerm 2

@bx2
Copy link

bx2 commented Apr 26, 2023

@ljseng a duplicate?

submit issue: #105
keymap updates: #152

@rogerkk
Copy link

rogerkk commented Apr 26, 2023

I'm experiencing the same in Gnome Terminal 3.44.0 on Linux.

@tinnguyen189atnos
Copy link

This is worked for me.

	chatgpt.setup({
		popup_input = {
			submit = "<CR>"
		}
	})

i am also facing this issue, remapping the submit key also doesn't seem to work unless I am doing something wrong.

"jackMort/ChatGPT.nvim",
  config = function()
    require("chatgpt").setup({
      chat = {
        prompt_input = {
          submit = "<C-g>"
        }
      }
    })
  end,
  requires = {
    "MunifTanjim/nui.nvim",
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim"
  }
})

@rogerkk
Copy link

rogerkk commented Apr 27, 2023

	chatgpt.setup({
		popup_input = {
			submit = "<CR>"
		}
	})

@tinnguyen189atnos That means you are no longer able to do multiline prompts, right?

@rogerkk
Copy link

rogerkk commented Apr 27, 2023

But I think the reason this works for @tinnguyen189atnos is that he is setting popup_input, not prompt_input like @ZacxDev mentions trying. Doing that, I was able to remap submit to CTRL+s as a workaround:

chatgpt.setup({
  popup_input = {
    submit = "<C-s>"
  }
})

@devnoot
Copy link

devnoot commented Apr 30, 2023

I was having this issue and it turned out to be how Windows terminal was handling Ctrl+Enter. I suspect this might be the issue for other terminals as well.

@jackMort jackMort closed this as completed May 3, 2023
@ljseng
Copy link
Author

ljseng commented May 4, 2023

@rogerkk @tinnguyen189atnos thanks very much! following remap works for me.

	chatgpt.setup({
		popup_input = {
			submit = "<CR>"
		}
	})

and @rogerkk yes you can still do multiline prompts. will enter newline character in windows terminal.

This is worked for me.

	chatgpt.setup({
		popup_input = {
			submit = "<CR>"
		}
	})

i am also facing this issue, remapping the submit key also doesn't seem to work unless I am doing something wrong.

"jackMort/ChatGPT.nvim",
  config = function()
    require("chatgpt").setup({
      chat = {
        prompt_input = {
          submit = "<C-g>"
        }
      }
    })
  end,
  requires = {
    "MunifTanjim/nui.nvim",
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim"
  }
})
	chatgpt.setup({
		popup_input = {
			submit = "<CR>"
		}
	})

@tinnguyen189atnos That means you are no longer able to do multiline prompts, right?

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

9 participants