Skip to content

[BUG] shift + Enter do not create new lines with snacks provider #79

Closed

Description

@S1M0N38

Bug Description

If claudecode.nvim is configure to use snacks provider, when pressing shift + Enter
no new line are created.

Expected Behavior

If the provider is set as "native" (or snacks is not installed), the shift + Enter command in claude code works.

Environment

  • Neovim version: [0.11.0]
  • Claude Code CLI version: [1.0.48]
  • OS: [macOS 15.4.1]
  • claudecode.nvim version: [91357d8]
  • Snacks.nvim version: [bc0630e43be5699bb94dadc302c0d21615421d93]

Activity

  1. S1M0N38 commented on Jul 10, 2025

    @S1M0N38
    Author

    For macOS there is the workaround to use Option+Enter instead of Ctrl+Enter.

  2. d3vw commented on Jul 17, 2025

    @d3vw

    I expect that ctrl + j to create a new line, is it possible?

  3. d3vw commented on Jul 17, 2025

    @d3vw

    oh, I find a new way to create new line:
    insert mode, input \<CR>, it is useful.

    Image
  4. alex35mil commented on Jul 31, 2025

    @alex35mil

    This is what worked reliably for me:

    opts = {
        terminal = {
            ---@module "snacks"
            ---@type snacks.win.Config|{}
            snacks_win_opts = {
                keys = {
                    claude_new_line = {
                        "<S-CR>",
                        function()
                            vim.api.nvim_feedkeys("\\", "t", true)
                            vim.defer_fn(function()
                                vim.api.nvim_feedkeys("\r", "t", true)
                            end, 10)
                        end,
                        mode = "t",
                        desc = "New line",
                    },
                },
            },
        },
    }
  5. ThomasK33 commented on Aug 8, 2025

    @ThomasK33
    Member

    Oh, that's nice, @alex35mil.

    I've added this as a default keybind in #116 and added you as a co-author, if that's fine with you.

  6. S1M0N38 commented on Sep 10, 2025

    @S1M0N38
    Author

    For the wezeterm users, you simply need to add the following keymap in config.keys

    { key = "Enter", mods = "SHIFT", action = wezterm.action({ SendString = "\x1b\r" }) },
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions