Suggestion: Better ergonomics for long text

Resolved 💬 16 comments Opened Feb 26, 2025 by aud Closed Jan 8, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Deleting/editing text after input:

Reproduction:

  • Enter in a bunch of text
  • See that it inserted a placeholder ([Pasted text +11] for eg).
  • If you try to edit that, or if you're pasting in multiple blocks, it's non-obvious how to handle and breaks the insertion if you edit that special text directly.

Suggestions:

  • Don't do smart truncation.
  • If truncation is non-negotiable, make [Pasted line +linecnt] some sort of special token that when you edit your prompt, it won't allow you to edit individual chars and instead force you to delete the whole _token_ (thus deleting the text).
$ claude
╭────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview!         │
│                                                    │
│   /help for help                                   │
│                                                    │
│   cwd: /Users/elliot/src/github.com/WithPage/page  │
╰────────────────────────────────────────────────────╯

> This is a really long text file
  This is a really long text file
  This is a really long text file
  This is a really long text file
  [Pasted text +35

⏺ I need to help you with a text file, but I don't see an actual file that was pasted. Could you please share the file again or tell me what you'd like me to do with it?

\ to insert a newline is a bit awkward

Almost like this needs an insert vs. command mode, similar to the bash mode. If you can be inserted into edit mode and go wild on the prompt. Another idea could be to allow some sort of swapping configuration away from \ to something a bit more fluid like cmd+enter.

View original on GitHub ↗

16 Comments

ashwin-ant collaborator · 1 year ago

The first part is interesting feedback, thanks! We'll discuss our options here.

For the second part, are you using iTerm? If so, you can run /terminal-setup and we'll automatically map Shift+Enter to newline. Would that work for you? Your idea of insert vs. command mode is interesting as well!

aud · 1 year ago

Thanks for looking! I'm using ghostty, not sure if there's an equivalent.

aud · 1 year ago

For an insert mode it could be as simple as @ to enter insert mode (similar to bash mode) that gives you more predictable text editing rules (like enter = newline).

roychri · 1 year ago

M-Enter (esc followed by enter) would be also accepted for a new line in multi line. (like aider)
CTRL-J could also be accepted for a new line multi line. (like charmbracelet's gum cli tool)

darinkishore · 1 year ago

Maybe /editor for opening in $EDITOR (like git commit msgs?)

m4dc4p · 1 year ago

+100 this. Entering mulit-line text in terminal is painful (WSL FWIW).

Even ctrl+enter to move to next line would be an improvment!

nikbrunner · 1 year ago
Maybe /editor for opening in $EDITOR (like git commit msgs?)

A shortcut to open up the prompt in temporary $EDITOR window would be super awesome.
For me that would be Neovim. In Lazygit when writing a commit I can press <kbd>Ctrl-o e</kbd> and I have the ability to edit the git commit message in a normal sized, temporary Neovim Buffer. On :wq it will close and commit. This type of flow would be super awesome for Claude Code.

There are already Vim Keybindings for the prompt itself, but I can't really do much with it, since pressing <kbd>Esc</kbd> to enter Normal Mode conflicts with quiting claude entierly. This issue is already mentioned here: #39.

I am also using Ghostty and Mac btw. I did not get the <kbd>M-Enter</kbd> to work. I am just escaping it for every enter.. \<Enter>.

peterkaminski · 1 year ago

#138 and #143 are near dupes.

mattduck · 1 year ago

New claude code user here. Not sure the best issue to put this, but on the multi-line support: this was one of the first things I looked for in the docs. I'm coming from Aider, which I found awkward for anything more than short single-line prompts, until I found its multi-line mode, which was a huge improvement.

It looks there are various dupes and feature requests for better multi-line support, or issues with the /terminal-setup solution, including: https://github.com/anthropics/claude-code/issues/138, https://github.com/anthropics/claude-code/issues/729, https://github.com/anthropics/claude-code/issues/1863 and https://github.com/anthropics/claude-code/issues/1203.

From my POV, how Aider handles it is totally fine and aligned with UX conventions:

  • Enter submits the prompt by default, ie. maintains the current behaviour (I think https://github.com/anthropics/claude-code/issues/729 was closed because it suggests changing defaults).
  • There's a config option to change this so that enter will insert a newline, and another binding will submit the prompt. Aider uses M-Enter for this binding.
  • If you really want complex text edits, there's an additional binding to open $EDITOR.

It would be great to have one chosen issue for tracking this feature request, as there's clearly some desire for it!

eduo · 1 year ago
M-Enter (esc followed by enter) would be also accepted for a new line in multi line. (like aider) CTRL-J could also be accepted for a new line multi line. (like charmbracelet's gum cli tool)

M in terminal can be mapped to option (alt), but then many keys become disabled in international keyboards, like @ or #

sangaline · 1 year ago

Was the /terminal-setup removed? It doesn't seem to be an available command for me with v1.0.31.

eefan000 · 1 year ago

I hope this feature must consider the usage environment of Windows users!!!!!
I don't know why support is the worst when over 90% of programmers are Windows users!!!

happymonday2019 · 8 months ago

✅ Citations Implementation Complete

The end-to-end citation flow is now fully operational in us-east-1. All AI services are collecting citations, and the data pipeline is successfully storing them in the Aurora database.

What Was Implemented

1. Database Migration (us-east-1)

  • Added 9 citation columns to ai_model_responses table
  • Created 5 indexes for efficient citation queries
  • Created 3 PostgreSQL helper functions for citation analysis
  • Created 3 analysis views for Equal Experts citation tracking

2. Data Flattener Updates

  • Updated aurora_flattener_lambda.py to extract 5 citation fields from S3 results
  • Fixed handling of empty string values for citation_quality_score (converts to NULL)
  • Files: scripts/aws/data_flattener/aurora_flattener_lambda.py (lines 297-304)

3. Database Client Updates

  • Updated aurora_data_api_client.py to include citation columns in INSERT statements
  • Properly handles JSONB for citations array and DECIMAL for citation_quality_score
  • Files: scripts/aws/data_flattener/aurora_data_api_client.py (lines 379-384, 688-693)

4. Lambda Deployment

  • Deployed updated data flattener Lambda to us-east-1
  • Successfully tested with 61 records from 8 files with 0 errors

Verified Results

Database Query Results (2025-10-21):

  • ✅ Citations JSONB: Full citation arrays with URLs and positions saved correctly
  • ✅ web_search_performed: Boolean flag tracking web searches
  • ✅ num_citations: Count of citations (e.g., 14 citations)
  • ✅ equal_experts_in_citations: Boolean tracking EE mentions in citations
  • ✅ citation_quality_score: DECIMAL(5,4) scores (e.g., 0.4250)

Citation Tracking View Results:

  • Perplexity/Sonar: 11 web searches today
  • 63.64% Equal Experts citation rate (7 out of 11 responses)
  • Average citation quality: 0.4250

Database Schema

New Columns:

  • citations JSONB - Full citation array from AI responses
  • web_search_performed BOOLEAN - Whether web search was used
  • web_search_timestamp TIMESTAMP WITH TIME ZONE - When search occurred
  • search_queries TEXT[] - Search queries used
  • num_sources INTEGER - Number of sources consulted
  • search_cost DECIMAL(10,6) - Cost of web search
  • equal_experts_in_citations BOOLEAN - Whether EE appears in citations
  • citation_quality_score DECIMAL(5,4) - Average citation relevance score
  • num_citations INTEGER - Count of citations in response

Analysis Views:

  • v_citation_analysis - Citation quality ratings and metrics
  • v_equal_experts_citation_tracking - EE citation rates by provider/model/date
  • v_citation_source_analysis - Top citation sources and domains

Migration Script

Created scripts/apply-citations-migration-simple.py for us-east-1 deployment.

All AI services (OpenAI, Claude, Gemini, Grok, Perplexity) are now successfully collecting and storing citation data!

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 6 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.