feat(cli): add multiline input support with Alt+Enter

- Enable custom-bindings feature in rustyline
- Bind Alt+Enter to insert newlines in interactive and accumulative modes
- Update calculate_visual_lines() to handle embedded newlines correctly
- Add tests for multiline visual line calculation

Note: Shift+Enter is not distinguishable in standard terminals, so Alt+Enter
is used as the multiline input trigger.
This commit is contained in:
Dhanji R. Prasanna
2026-02-06 14:09:12 +11:00
parent abfac197ab
commit 31bdcb651b
4 changed files with 50 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ tracing-subscriber = { workspace = true, features = ["env-filter"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_yaml = "0.9"
rustyline = { version = "17.0.1", features = ["derive", "with-dirs"] }
rustyline = { version = "17.0.1", features = ["derive", "with-dirs", "custom-bindings"] }
dirs = "5.0"
tokio-util = "0.7"
sha2 = "0.10"