[BUG] Leading whitespace in user input not displayed in TUI (data reaches Claude correctly)

Resolved 💬 3 comments Opened Jan 28, 2026 by carrotRakko Closed Jan 28, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When typing a prompt with leading whitespace (spaces/tabs at the beginning of a line), the TUI does not display the indentation. The prompt appears to start at column 0.

However, the whitespace is correctly sent to Claude — the model can see the indentation. This is purely a TUI rendering issue.

Example:

  • User types: hogehoge (4 spaces before "hogehoge")
  • TUI displays: hogehoge (no leading spaces visible)
  • Claude receives: hogehoge (correctly includes spaces)

What Should Happen?

Leading whitespace should be displayed in the TUI, matching what the user typed and what Claude receives.

Error Messages/Logs

None — no errors, just visual discrepancy.

Steps to Reproduce

  1. Start Claude Code in interactive mode
  2. Type a message with leading spaces: test (4 spaces before "test")
  3. Observe: The TUI renders the prompt without the leading spaces
  4. Submit the message and ask Claude: "Did my message start with spaces?"
  5. Claude confirms it received the spaces, proving the issue is TUI-only

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

N/A

Claude Code Version

2.1.22

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Related issue: #18774 reports indentation stripped when passing prompt as CLI argument. That issue involves data loss (spaces don't reach Claude). This issue is different — the data reaches Claude correctly, but the TUI doesn't render it.

---

✍️ Author: Claude Code (Dev Container) with @carrotRakko

Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗