claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

/terminal-setup error message contradicts itself regarding Windows Terminal support

Open philcarbone opened this issue 1 year ago • 37 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The /terminal-setup command displays contradictory information about Windows Terminal support.

The error message states: "Terminal setup cannot be run from windows-terminal"

But then immediately instructs: "Run /terminal-setup directly in one of these terminals: Windows: Windows Terminal"

This creates confusion about whether Windows Terminal is actually supported for this feature.

What Should Happen?

The error message should be consistent and provide clear, accurate guidance:

Either:

  1. Remove "Windows Terminal" from the supported terminals list if it's not actually supported, OR
  2. Fix the detection logic to properly support Windows Terminal

The error message should not contradict itself by both rejecting and recommending the same terminal.

Error Messages/Logs


Steps to Reproduce

  1. Open Windows Terminal
  2. Run the /terminal-setup command in Claude Code
  3. Observe the contradictory error message

Expected vs Actual:

  • The error says Windows Terminal is NOT supported: "cannot be run from windows-terminal"
  • But then lists Windows Terminal as supported: "Windows: Windows Terminal"

Environment:

  • Platform: Windows
  • Terminal: Windows Terminal
  • This appears to be an error message consistency issue rather than a functional bug

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

Latest (this is an error message consistency issue, not version-specific)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

philcarbone avatar Sep 26 '25 02:09 philcarbone

I used CC to submit this with Playwright ;)

philcarbone avatar Sep 26 '25 02:09 philcarbone

Does anyone know if there is a workaround so we can get shift+enter working in windows terminal?

Update: @IKnewOne provided this workaround downthread: https://github.com/anthropics/claude-code/issues/8208#issuecomment-3578237605

rcocks-hl avatar Oct 09 '25 13:10 rcocks-hl

If it helps at all I see this issue in Claude Code 2.0.24 running the most recent versions of both Windows Terminal (1.23.12811.0) and Windows Terminal Preview (1.24.2682.0)

amchase avatar Oct 20 '25 19:10 amchase

I tried also with an older version Microsoft.WindowsTerminal_1.23.12371.0. Same problem

karstennilsen avatar Oct 24 '25 13:10 karstennilsen

Having this issue with the following environment:

Windows Terminal Preview 1.24.2682.0
PowerShell 7.6.0-preview.5

While this seems like a simple QoL issue, my Shift+Enter muscle memory is ruining chat sessions, or simple mistypes when trying to utilize the \ workaround. Having a fix for this would be a very welcome improvement!

Derjyn avatar Oct 28 '25 08:10 Derjyn

Having this issue with the following environment:

Windows Terminal Preview 1.24.2682.0
PowerShell 7.6.0-preview.5

While this seems like a simple QoL issue, my Shift+Enter muscle memory is ruining chat sessions, or simple mistypes when trying to utilize the \ workaround. Having a fix for this would be a very welcome improvement!

After spending a week off using claude, I now have the opposite problem, I keep hitting \ + enter, and accidentally sending my co-workers half-finished thoughts on slack!

rcocks-hl avatar Oct 28 '25 08:10 rcocks-hl

I'm experiencing this same issue:

  • OS: Windows 10.0.26200 (Windows 11)
  • Terminal: Windows Terminal (PowerShell 7.5.4)
  • Claude Code: Latest version
  • Environment variables confirm WT_SESSION is present

zeynalnia avatar Oct 31 '25 00:10 zeynalnia

PowerShell 7.5.4 + Windows Terminal app + Windows 11 also happen

Mecrano avatar Nov 10 '25 02:11 Mecrano

Same here!

revoconner avatar Nov 17 '25 22:11 revoconner

same here with WT 1.23.12811.0 CC 2.0.50 (Claude Code)

Lesani avatar Nov 24 '25 09:11 Lesani

Does anyone know if there is a workaround so we can get shift+enter working in windows terminal?

ask claude for the json command & edit your settings.json file in the windows terminal (ctrl + shift + ,)

Gosuj avatar Nov 24 '25 17:11 Gosuj

This update to Windows Terminal settings.json is working for me:

"actions":
    [
        {
            "command":
            {
                "action": "sendInput",
                "input": "\u001b\r"
            },
            "id": "User.sendInput.8882FD6D"
        }
    ],

jrnewton avatar Nov 25 '25 14:11 jrnewton

The solution from @jrnewton didn't work for me right away; it seems like this is the result of terminal later altering his command. What worked for me was

      {
          "command": {
              "action": "sendInput",
              "input": "\n"
          },
          "keys": "shift+enter"
      },

After saving json and restarting the terminal, the values changed to the id version ( "id": "User.sendInput.DFCDAF06" ), but it kept working

KnewOne avatar Nov 26 '25 00:11 KnewOne

The json setting was generated by Claude Code... and pasted into settings.json by me. I don't think it was modified after the fact...

jrnewton avatar Nov 26 '25 02:11 jrnewton

The solution from @jrnewton didn't work for me right away; it seems like this is the result of terminal later altering his command. What worked for me was

      {
          "command": {
              "action": "sendInput",
              "input": "\n"
          },
          "keys": "shift+enter"
      },

After saving json and restarting the terminal, the values changed to the id version ( "id": "User.sendInput.DFCDAF06" ), but it kept working

This worked for me, previous responses didn't

Quackzoer avatar Nov 27 '25 11:11 Quackzoer

hey guys. I had this problem also, chatted with ChatGPT 5.1, and the devil solved it :)

I use vscode with WSL (so the vscode client is on windows 11, and it connects to vscode server on WSL). The bug is from vscode actually. Here's the part of the chat that solved it:

====chatgpt response====

Yeah, this one’s not on you. It’s a VS Code + WSL mess.

Right now:

  • showkey -a shows only ^M 13 0x0d for Shift+Enter → VS Code is not sending the ESC (\u001b) that your keybindings.json claims.
  • Your keybindings.json at /home/hisham/.config/Code/User/keybindings.json has the Claude binding.
  • The Keyboard Shortcuts UI shows no Shift+Enter binding.

That means one thing:

You edited the wrong keybindings file. VS Code is using the Windows host keybindings, not the WSL one Claude touched.

Claude’s /terminal-setup script is dumb here: it writes to ~/.config/Code/User/keybindings.json inside WSL, but VS Code (running on Windows) reads C:\Users\Hisham\AppData\Roaming\Code\User\keybindings.json. So the binding never actually applies.


Fix: put the binding in the real VS Code keybindings file

  1. In the SAME VS Code window, press:

    Ctrl + Shift + P
    
  2. Type: “Open Keyboard Shortcuts (JSON)” and hit Enter.

    This opens the actual keybindings file VS Code uses on Windows, something like:

    C:\Users\Hisham\AppData\Roaming\Code\User\keybindings.json
    
  3. Make its contents look like this (if it’s empty, make it an array with one object):

    [
      {
        "key": "shift+enter",
        "command": "workbench.action.terminal.sendSequence",
        "args": {
          "text": "\u001b\r"
        },
        "when": "terminalFocus"
      }
    ]
    

    If there are already other bindings, just add this object inside the array, separated by commas.

  4. Save the file.

  5. Now open the Keyboard Shortcuts UI (Ctrl+K Ctrl+S), search for shift+enter and you should see:

    • Command: workbench.action.terminal.sendSequence
    • When: terminalFocus

If you don’t see it there, you’re still editing the wrong file.


Verify the binding actually works

In the WSL terminal in VS Code (no Claude running), run:

showkey -a

Press Shift+Enter.

You should now see:

^[     27  0033 0x1b
^M     13  0015 0x0d

If you see both 27 and 13 → VS Code is sending ESC + Enter correctly. Before, you only had the 13 line.


Use it with Claude

Now:

claude

At the You: prompt:

  • Type some text.
  • Press Shift+Enter → should give you a new line within the same prompt (depending on how 2.0.57 handles it).
  • Press Enter → sends.

If Shift+Enter is still just “send”, that’s on Claude Code’s current behavior, not VS Code. But your keybinding and terminal wiring will finally be correct.


Devil’s advocate: this whole thing is brittle. Claude’s /terminal-setup doesn’t understand WSL and writes to the wrong config path. If Anthropic doesn’t fix that, you’ll have to remember that any “automatic” keybinding changes it does inside WSL are basically no-ops and you need to mirror them manually into the Windows-side keybindings.json.

Hisham-Hussein avatar Dec 03 '25 15:12 Hisham-Hussein

Workaround for Windows Terminal users:

Add this to your Windows Terminal settings.json:

"actions": [ { "command": { "action": "sendInput", "input": "\u001b\r" }, "keys": "shift+enter" } ]

Steps:

  1. Open Windows Terminal
  2. Press Ctrl+, → Click the gear icon (bottom left) → "Open JSON file"
  3. Find the "actions" array and add the config above
  4. Save and restart Windows Terminal

Shift+Enter now works for multi-line prompts in Claude Code.

chrisboulet avatar Dec 04 '25 16:12 chrisboulet

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] avatar Jan 11 '26 10:01 github-actions[bot]

it's still relevant

remal avatar Jan 11 '26 14:01 remal

Seems this is still a bug.

jbriley avatar Jan 17 '26 16:01 jbriley