MoonshotAI / MoonshotAI/kimi-cli

feat(shell): support Shift+Enter for inserting newlines

Open
#2,254 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

Feature Request: Support Shift+Enter for inserting newlines

What feature would you like to see?

Add Shift+Enter as an alternative shortcut for inserting a newline in the interactive prompt, alongside the existing Ctrl-J and Alt-Enter bindings.

Current behavior
Shortcut Action
Enter Submit message
Ctrl-J Insert newline
Alt-Enter Insert newline
Shift+Enter Not supported
Desired behavior
Shortcut Action
Enter Submit message
Shift+Enter Insert newline
Ctrl-J / Alt-Enter Keep for backward compatibility
Why this matters

I am an active user of multiple AI coding agents. My daily workflow includes Claude Code, Codex CLI, OpenCode, and Amp. In all of them, the pattern is consistent:

  • Enter → submit
  • Shift+Enter → insert newline

This has become the de-facto standard across modern chat UIs (ChatGPT, Claude, Discord, Slack, Cursor, VS Code Copilot Chat, etc.). Muscle memory from these platforms makes the current Ctrl-J / Alt-Enter behavior in Kimi CLI feel unintuitive and frustrating.

I have lived in China for twelve years. I am genuinely proud to see Chinese AI companies like Moonshot building world-class models and tools. Kimi K2.5 and K2 are disruptive and impressive. I want to use Kimi Code CLI more — it is already quite good for many tasks, and I believe it has enormous potential. But this small UX friction constantly pulls me out of flow. Every time I instinctively hit Shift+Enter and the message submits prematurely, I have to stop and remind myself: "Kimi is different."

I do not believe I am the only one who experiences this. Supporting Shift+Enter would align Kimi CLI with the expectations of millions of developers who are trained on this standard. It would be a small change with a large community impact.

Proposed implementation

The change should be minimal and non-breaking:

  1. Add Shift+Enter (s-enter in prompt_toolkit) alongside the existing newline keybindings in src/kimi_cli/ui/shell/prompt.py.
  2. Update the bottom toolbar hint from ctrl-j: newline to shift-enter / ctrl-j: newline.
  3. Update the English documentation (docs/en/reference/keyboard.md, docs/en/guides/interaction.md) to list Shift+Enter.

No terminal protocol manipulation, no breaking changes to existing behavior. Ctrl-J and Alt-Enter should continue to work exactly as they do today.

Environment
  • kimi-cli version: latest (1.43.0)
  • OS: macOS / Linux / Windows (applies to all platforms)

功能请求:支持 Shift+Enter 插入换行

期望的功能

在交互式提示符中增加 Shift+Enter 作为插入换行的快捷键,与现有的 Ctrl-JAlt-Enter 并存。

当前行为
快捷键 动作
Enter 发送消息
Ctrl-J 插入换行
Alt-Enter 插入换行
Shift+Enter 不支持
期望的行为
快捷键 动作
Enter 发送消息
Shift+Enter 插入换行
Ctrl-J / Alt-Enter 保留,向后兼容
为什么这很重要

我是多个 AI 编程代理的活跃用户。日常工作中我使用 Claude CodeCodex CLIOpenCodeAmp。它们都有一个一致的操作模式:

  • Enter → 发送
  • Shift+Enter → 插入换行

这已成为现代聊天界面的事实标准(ChatGPT、Claude、Discord、Slack、Cursor、VS Code Copilot Chat 等)。来自这些平台的肌肉记忆使得 Kimi CLI 当前的 Ctrl-J / Alt-Enter 行为显得不直观且令人沮丧。

我在中国生活了十二年。看到 Moonshot 这样的中国 AI 公司正在构建世界一流的模型和工具,我感到非常自豪。Kimi K2.5 和 K2 具有颠覆性且令人印象深刻。我希望更多地使用 Kimi Code CLI——它在很多任务上已经相当出色,我相信它有巨大的潜力。但这个小小的用户体验摩擦总是让我中断心流。每次我本能地按下 Shift+Enter 而消息却提前发送时,我都不得不停下来提醒自己:"Kimi 不一样。"

我相信不止我一个人遇到这个问题。支持 Shift+Enter 将使 Kimi CLI 与数百万已经熟悉这一标准的开发者的期望保持一致。这将是一个改动很小、但社区影响很大的改进。

建议的实现方式

改动应该最小化且不破坏现有功能:

  1. src/kimi_cli/ui/shell/prompt.py 中,将 Shift+Enter(prompt_toolkit 中为 s-enter)添加到现有的换行快捷键绑定中。
  2. 将底部工具栏提示从 ctrl-j: newline 更新为 shift-enter / ctrl-j: newline
  3. 更新英文文档(docs/en/reference/keyboard.mddocs/en/guides/interaction.md)以列出 Shift+Enter

不需要操作终端协议,也不会破坏现有行为。Ctrl-JAlt-Enter 应继续完全按今天的方式工作。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/kimi_cli/ui/shell/prompt.py by reviewing the existing Ctrl-J and Alt-Enter newline bindings and toolbar hint. Update the English entries in docs/en/reference/keyboard.md and docs/en/guides/interaction.md. Done means Shift+Enter inserts a newline while Enter still submits and the existing bindings continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.