CLI: Code block difficult to copy paste

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Hi there,

Thanks for the work on the CLI, it’s much better to run long agentic sessions instead of keeping my Mac awake and on WiFi (and I don’t want to use Cloud Agents).

The code blocks are difficult to copy-paste because of the line numbers, could you improve this somehow? Same with copy-pasting multi-line commands.

Adding a screenshot plus a screenshot of Claude Code for reference.
Using Mac iTerm → SSH to Linux VM → tmux. But this also happens on normal Linux through SSH (not just a tmux issue).

Steps to Reproduce

Open a CLI agent session, ask “Give me a code snippet that prints “hi” in a loop in python”.
It then prints:

     1 │while True:
     2 │    print("hi")

Expected Behavior

The user should copy just the code without the line number formatting.

Screenshots / Screen Recordings


Screenshot 2026-07-16 at 3.17.43 PM.png

Operating System

Linux

Version Information

CLI:
╭────────────────────────────────────────────────────────────╮
│ │
│ About Cursor CLI │
│ │
│ CLI Version 2026.07.13-7fe37d2 │
│ Model Cursor Grok 4.5 High Fast │
│ OS linux (x64) │
│ Terminal unknown │
│ Shell zsh │
│ Last Request ID ae500bab-a859-43b9-80f5-1cf02f7a4bb2 │
│ User Email [email protected]
│ │
╰────────────────────────────────────────────────────────────╯

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report and for the kind words about the CLI.

Line numbers in code blocks are a display setting that currently defaults to off. You’re still seeing them because your config has them set to on from an older install. The default was flipped later, and it doesn’t apply to existing configs.

How to remove them:

  • In the current session, run /line-numbers to toggle them off.
  • Or manually: open ~/.cursor/cli-config.json and set "display": { "showLineNumbers": false }.

After that, the N │ gutter will disappear and code will copy cleanly.

About multi-line shell commands: mouse selection in a terminal will still grab the TUI borders or chrome, that’s normal for any TUI. There’s a /copy command that puts the last message into your clipboard, but over SSH it needs OSC 52 support, so on your SSH plus tmux setup, toggling /line-numbers is the more reliable way to copy code cleanly.

Let me know if anything still gets included after you turn it off.

Works for me, thanks for the quick reply! Closing the issue now.