Skip to content

CLI should support multi-line mode in input box #14

Description

@RyanHecht

Currently, it's possible to paste or write multiple lines into the input box but it's impossible to navigate or use other keyboard shortcuts.

For example, I would expect shift+enter to create a new line (or alternatively, enter to create a new line and shift+enter to submit)

After pasting in content with multiple lines, I should be able to use the arrow keys to navigate the textual input, where currently it will start going through the command history.

Activity

  1. RyanHecht commented on Oct 1, 2025

    @RyanHecht
    CollaboratorAuthor

    0.0.329 and 0.0.331 both landed some intermediary features on our way to supporting multi-line input! I'll continue to update this issue as we reach more milestones :)

  2. jcubic commented on Oct 1, 2025

    @jcubic

    Another feature is to allow picking from dropdown inside multi-line.

    When you copy-paste, a multi-line prompt that contains

    <SPEC> </SPEC>
    

    You should be able to insert a file with @ between the tags.

  3. tobiashochguertel commented on Oct 4, 2025

    @tobiashochguertel

    My current workaround is to copy two empty lines into the clipboard and paste them into the input field.
    That works so far.

    You could now create a keyboard shortcut in your terminal that is always activated when you are in Copilot CLI and acts with a paste of two empty lines when you press Shift + Enter; just an idea for an improved workaround.

  4. andrewneilson commented on Oct 4, 2025

    @andrewneilson

    If anyone has been copying and pasting to get multi-line: I think the easiest workaround right now is just backslash.

    Image

    Definitely looking forward to a better option though (ctrl+J has been fine in claude code and codex IMO).

  5. RobertSundling commented on Oct 7, 2025

    @RobertSundling

    Since the initial release, I've just always been pressing Ctrl+Enter instead of Shift+Enter to insert newlines, and it works fine (on Windows at least). However, it's sometimes hard to remember to press Ctrl+Enter when I'm going back and forth between this and other programs which use Shift+Enter. As such, it'd definitely be nice if Shift+Enter simply mapped to Ctrl+Enter since that is more standard.

  6. RyanHecht commented on Oct 8, 2025

    @RyanHecht
    CollaboratorAuthor

    Multi-line input with Shift+Enter has shipped for terminals that support the Kitty protocol in 0.0.337 -- broader terminal support on the way!

  7. RobertSundling commented on Oct 8, 2025

    @RobertSundling

    Multi-line input with Shift+Enter has shipped for terminals that support the Kitty protocol in 0.0.337 -- broader terminal support on the way!

    Excellent! And I'm sure you're aware that doesn't happen to include Windows, but I can confirm that Ctrl+Enter continues to work with Windows in 0.0.337, so we still have that workaround.

  8. RyanHecht commented on Oct 9, 2025

    @RyanHecht
    CollaboratorAuthor

    We unfortunately had to move Kitty protocol support behind the COPILOT_KITTY environment variable in 0.0.338 -- we had some reported regressions in VSCode on Windows and some paste problems. If you're unaffected by these roadblocks (or don't mind them), you can re-enable it by setting that environment variable to true!

  9. RobertSundling commented on Oct 13, 2025

    @RobertSundling

    For anyone else experiencing this issue on Windows, I found a simple configuration change which allows Shift+Enter to be used for multi-line input in GitHub Copilot CLI in Windows Terminal. (This solves this issue for me.)

    The change configures Windows Terminal to send a linefeed character when pressing Shift+Enter. In the GitHub Copilot CLI multi-line editor, a linefeed (\n) is treated as a newline whereas a carriage return (\r, the default character sent when pressing Shift+Enter) submits the input.

    This involves adding a few lines to your Windows Terminal settings.json file. To find this file, open Windows Terminal, open "Settings" under the downward-pointing arrow at the top of the window, then click "Open JSON file" in the lower left.

    In the top-level "actions" section, I added:

            {
                "command":
                {
                    "action": "sendInput",
                    "input": "\n"
                },
                "id": "linefeed"
            },

    This creates a new action called linefeed which sends a linefeed character. In the top-level "keybindings" section, I added:

            {
                "id": "linefeed",
                "keys": "shift+enter"
            },

    This binds Shift+Enter to the new linefeed action. Note that if you copy and paste these as-is, paste them at the beginnings of the sections. Otherwise, be mindful of the trailing commas; if you add these to the ends of the sections, put the commas before these new entries rather than after.

    After saving this file, Shift+Enter will work for multi-line input immediately.

  10. tobiashochguertel commented on Oct 15, 2025

    @tobiashochguertel

    The new /terminal-setup slash command installs some keybindings into the keybindings.json file, but it doesn't respect the existing comments in this JSONC or JSON5 document, so after executing the command, the keybindings.json is reformatted and without any comments.

    I think this slash command could be improved:

    • Show a warning to the user about the removal of the comments, reformatting, and sorting of the keybindings, with a prompt if the user wants to continue.
    • Prompt for creating first a backup of the existing keybindings.json file with a date+time -> keybindings.json.bak-$(date +%Y-%m-%d_%H:%M:%S).
    • and use a JSON5 library or JSONC library, which can preserve comments in json documents with comments.
    • Create or show a documentation with the keybindings setup for the terminal setup, which she/he can do manually to its keybindings.json file.
    • Or let AI do it 😆, but warn that you pay with a premium request 💃.
  11. RyanHecht commented on Oct 16, 2025

    @RyanHecht
    CollaboratorAuthor

    Hi folks! As of 0.0.342, we now support Shift+Ctrl for multiline input in terminals that support the Kitty protocol by default. We also support it in VSCode and its forks by running the /terminal-setup command!

    @tobiashochguertel, I opened #325 to track this

  12. XuanLee-HEALER commented on Oct 26, 2025

    @XuanLee-HEALER

    I am unable to use Shift+Enter for multi-line input in the GitHub Copilot CLI when running it inside the VS Code Integrated Terminal on my macOS system. Pressing Shift+Enter immediately submits the prompt instead of inserting a newline.

    I have already performed the following troubleshooting steps:

    • executed terminal-setup, and the output showed: 'Key bindings for VS Code are already set up. Your terminal already has multiline support with Shift+Enter and Ctrl+Enter.'
    • Checked VS Code Keybindings: I checked the VS Code Keyboard Shortcuts (JSON) file for any conflicting keybindings related to Shift+Enter (specifically those with a when condition related to terminalFocus). Even after modifying related terminal keybindings, the issue persists.
    • Confirmed Environment: The issue is consistently reproducible.

    Steps to Reproduce:

    • Open the Integrated Terminal in VS Code.
    • Run copilot to start the CLI session.
    • Type a partial prompt.
    • Press Shift+Enter (↑+Enter).

    Expected Result: A newline character (\n) should be inserted.
    Actual Result: The current prompt is submitted immediately.

    My Environment Details:

    Operating System: macOS (Darwin arm64 25.0.0)
    VS Code Version: Version: 1.105.1 (Universal)
    Commit: 7d842fb85a0275a4a8e4d7e040d2625abbf7f084
    Date: 2025-10-14T22:33:36.618Z
    Copilot CLI Version: 0.0.351

    Integrated Terminal Shell: fish

    Request for Guidance:

    Could you provide guidance on how to configure the Copilot CLI or the VS Code Integrated Terminal on macOS to correctly send the linefeed (\n) character when Shift+Enter is pressed? Is there a known workaround or configuration file for macOS users?

  13. laeubi commented on Nov 18, 2025

    @laeubi

    I think it would really help to show the newline shortcut in the below line where it already shows Ctrl+c / Ctrl+r hints!

  14. JeffreyCA commented on Nov 25, 2025

    @JeffreyCA
    Member

    There's a bug where /terminal-setup doesn't work properly in Dev Containers or GitHub Codespaces - filed an issue here: #657

    Here's the workaround:

    1. Activate Command Palette (Ctrl+Shift+P or Cmd+Shift+P)

    2. Select Preferences: Open Keyboard Shortcuts (JSON)

    3. Insert the following into the JSON array:

      {
          "key": "ctrl+enter",
          "command": "workbench.action.terminal.sendSequence",
          "when": "terminalFocus",
          "args": {
              "text": "\\\r\n"
          }
      },
      {
          "key": "shift+enter",
          "command": "workbench.action.terminal.sendSequence",
          "when": "terminalFocus",
          "args": {
              "text": "\\\r\n"
          }
      }
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