Skip to content

Support Shift+Enter for multiline input (industry standard) #9239

Closed

Description

@mekhontsev

That would be nice to have something like ImGuiInputTextFlags_ShiftEnterForNewLine.

It is the similar to this discussion.

Tools that use Shift+Enter for multiline:

Chrome dev console, ChatGPT, GitHub Copilot Chat, VSCode, Slack, Discord, Jupyter, etc.

Activity

  1. ocornut commented on Feb 16, 2026

    @ocornut
    Owner

    Hello,

    What would it need a new flag? Can you help me clarify this?

    WITHOUT ImGuiInputTextFlags_CtrlEnterForNewLine:

    • Enter: new line (current behavior)
    • Ctrl+Enter: validate (current behavior)
    • Shift+Enter: new line (suggested new behavior)

    WITH ImGuiInputTextFlags_CtrlEnterForNewLine:

    • Enter: validate (current behavior)
    • Ctrl+Enter: new-line (current behavior)
    • Shift+Enter: new line (suggested new behavior)

    By this logic:

    (1) There is no need for a new flag: Shift+Enter would always enter a new line.

    (2) ImGuiInputTextFlags_CtrlEnterForNewLine could in theory be renamed ImGuiInputTextFlags_EnterToValidate aka invert the description to instead focus on the fact that this is primarily changing the behavior of the most-common "Enter" action and put less emphasis on Ctrl+Enter for new-line, since Shift+Enter always work.

    ImGuiInputTextFlags_EnterToValidate = 1 << 8,
    ImGuiInputTextFlags_CtrlEnterForNewLine = ImGuiInputTextFlags_EnterToValidate,
  2. mekhontsev commented on Feb 17, 2026

    @mekhontsev
    Author

    Nice! Thanks for the clarification! )

  3. ocornut commented on Feb 17, 2026

    @ocornut
    Owner

    Hello,
    Seems like you misunderstood my message as the feature is not implemented yet and I was hoping for your feedback.

  4. mekhontsev commented on Feb 17, 2026

    @mekhontsev
    Author

    Okay, I like your proposal, it's perfect for my project. I plan to use the first bechaviour: WITHOUT ImGuiInputTextFlags_CtrlEnterForNewLine. In my opinion, the second option (WITH ImGuiInputTextFlags_CtrlEnterForNewLine) is also useful...

  5. ocornut commented on Feb 24, 2026

    @ocornut
    Owner

    Added Shift+Enter in 68a91d3.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址