Ctrl+L doesn’t add terminal context when the terminal is in a detached window

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When the terminal is docked inside the main Cursor window, pressing Ctrl+L correctly adds the terminal output to the AI chat.
But if I move the terminal into a separate detached window, the same shortcut no longer adds the terminal context — it only toggles the AI chat panel.

Is this expected behavior?
And is there a way (or planned feature) to allow Ctrl+L to send context from a detached terminal window as well?

Steps to Reproduce

Open the integrated terminal in Cursor.
Use Ctrl+L → terminal context is added to chat.
Detach the terminal into a new window.
Press Ctrl+L → chat toggles, but no terminal context is added.

Expected Behavior

Ctrl+L should add the terminal context to the AI chat even when the terminal is in a detached window

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.20 (user setup)
VSCode Version: 1.105.1
Commit: b3573281c4775bfc6bba466bf6563d3d498d1070
Date: 2025-12-12T06:29:26.017Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This looks like a bug in the standalone terminal window mode.

Could you share:

  • The log from Help > Toggle Developer Tools while pressing Ctrl+L in the standalone window
  • The output of Developer: Toggle Keyboard Shortcuts Troubleshooting after pressing Ctrl+L in both cases
  • Whether you have any custom keybindings for Ctrl+L and which shell you use in the terminal

Once we have these details and a stable repro, we’ll pass it on for a fix. Let me know if the workaround helps.

  • The log from Help > Toggle Developer Tools while pressing Ctrl+L in the standalone window

    I opened Help Help > Toggle Developer Tools and a separate window appeared of Developer Tools. I opened Console and pressed Ctrl+L. Just nothing appeared in Console. At the same time AI Chat removed (toggles on and off)

  • The output of Developer: Toggle Keyboard Shortcuts Troubleshooting after pressing Ctrl+L in both cases

    Please tell me where can i find this functionality - “Developer: Toggle Keyboard Shortcuts Troubleshooting“

  • Whether you have any custom keybindings for Ctrl+L and which shell you use in the terminal

    Also i do not know how to see those keybindings and how to get what is my “shell”, sorry (

    If you can help me with finding those endpoints - i will send it immediately.

I found some keybindings here

Also i found out that when i first set focus to somewhere else from ai chat say to an opened file, then move focus to integrated terminal, then select needed piece of logs from terminal and then press Ctrl+L - it does exactly what i need, it passed that data into ai chat. So to make this work i need to remove focus from AI chat somehow. I think that is a bug cause it works fine from imbedded terminal (not detached)

Thanks for the additional details! Great find with the focus switching workaround.

I’ll help you find the right endpoints:

Developer: Toggle Keyboard Shortcuts Troubleshooting:

  • Press Ctrl+Shift+P (Command Palette)
  • Type “keyboard shortcuts troubleshooting”
  • Select “Developer: Toggle Keyboard Shortcuts Troubleshooting”
  • Then press Ctrl+L in both cases (built-in terminal and detached) - logs will appear in the bottom right corner

Shell type:

  • In the terminal run: echo $SHELL (if Git Bash/WSL)
  • Or echo %COMSPEC% (if Command Prompt)
  • Or just check the dropdown menu in the top right of the terminal - it should show the type (PowerShell/CMD/Git Bash/etc)

Once we have this data, I’ll pass it to the team.

  1. Keyboard logs with detached window upon Ctrl+L:
    2025-12-17 21:43:22.301 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
    2025-12-17 21:43:22.301 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched
    2025-12-17 21:43:22.301 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
    2025-12-17 21:43:22.302 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 (‘Ctrl’)
    2025-12-17 21:43:22.302 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: | Resolving ctrl+L
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: KeyL, keyCode: 76, key: l
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: KeyL, keyCode: 42 (‘L’)
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: | Resolving ctrl+L
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
    2025-12-17 21:43:22.709 [info] [Window] [KeybindingService]: + Invoking command aichat.newchataction.
    2025-12-17 21:43:22.835 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
    2025-12-17 21:43:22.835 [info] [Window] [KeybindingService]: | Resolving ctrl+L
    2025-12-17 21:43:22.835 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
    2025-12-17 21:43:23.009 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
    2025-12-17 21:43:23.009 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched
    2025-12-17 21:43:23.009 [info] [Window] [KeybindingService]: + Ignoring single modifier ctrl due to it being pressed together with other keys.

  2. Keyboard logs with imbedded window upon Ctrl+L (also does not work!!):
    2025-12-17 21:47:58.400 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
    2025-12-17 21:47:58.400 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 (‘Ctrl’)
    2025-12-17 21:47:58.401 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
    2025-12-17 21:47:58.704 [info] [Window] [KeybindingService]: + Ignoring single modifier ctrl due to it being pressed together with other keys.

  3. In the terminal run: echo $SHELL (if Git Bash/WSL) - empty string
    Or echo %COMSPEC% (if Command Prompt) - empty string
    PowerShell (default) in the dropdown menu

It looks like i get different powershells when i just get terminal from Ctrl+J and when i run python file with “Run python file“ - they behave different. So when i Ctrl+J and then select some data in terminal and press Ctrl+L - then info goes straight into the ai chat window as expected but only in imbedded terminal:
2025-12-17 21:52:15.953 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
2025-12-17 21:52:15.954 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched
2025-12-17 21:52:15.954 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
2025-12-17 21:52:15.954 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 (‘Ctrl’)
2025-12-17 21:52:15.954 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2025-12-17 21:52:16.160 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
2025-12-17 21:52:16.160 [info] [Window] [KeybindingService]: | Resolving ctrl+L
2025-12-17 21:52:16.161 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
2025-12-17 21:52:16.161 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: KeyL, keyCode: 76, key: l
2025-12-17 21:52:16.161 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: KeyL, keyCode: 42 (‘L’)
2025-12-17 21:52:16.161 [info] [Window] [KeybindingService]: | Resolving ctrl+L
2025-12-17 21:52:16.161 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
2025-12-17 21:52:16.161 [info] [Window] [KeybindingService]: + Invoking command aichat.newchataction.
2025-12-17 21:52:16.418 [info] [Window] [KeybindingService]: + Ignoring single modifier ctrl due to it being pressed together with other keys.

And the same in detached window:

2025-12-17 21:55:40.475 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
2025-12-17 21:55:40.475 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched
2025-12-17 21:55:40.475 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control
2025-12-17 21:55:40.476 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 (‘Ctrl’)
2025-12-17 21:55:40.476 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2025-12-17 21:55:40.764 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
2025-12-17 21:55:40.764 [info] [Window] [KeybindingService]: | Resolving ctrl+L
2025-12-17 21:55:40.765 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
2025-12-17 21:55:40.765 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: KeyL, keyCode: 76, key: l
2025-12-17 21:55:40.765 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: KeyL, keyCode: 42 (‘L’)
2025-12-17 21:55:40.765 [info] [Window] [KeybindingService]: | Resolving ctrl+L
2025-12-17 21:55:40.765 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
2025-12-17 21:55:40.765 [info] [Window] [KeybindingService]: + Invoking command aichat.newchataction.
2025-12-17 21:55:40.882 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
2025-12-17 21:55:40.882 [info] [Window] [KeybindingService]: | Resolving ctrl+L
2025-12-17 21:55:40.883 [info] [Window] [KeybindingService]: \ From 2 keybinding entries, matched aichat.newchataction, when: no when condition, source: built-in.
2025-12-17 21:55:41.083 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
2025-12-17 21:55:41.083 [info] [Window] [KeybindingService]: \ Keyboard event cannot be dispatched
2025-12-17 21:55:41.083 [info] [Window] [KeybindingService]: + Ignoring single modifier ctrl due to it being pressed together with other keys.

Also i noticed that sometimes pressing Ctrl+L just deletes all the info in AI Chat withouy any change to restore that info! So i write a lot of text, then try to append lines from terminal, press Ctrl+L and all m text just evaporates without adding those lines from terminal ((

Thanks for the detailed logs, they were really helpful.

The keybinding fires correctly in both cases (aichat.newchataction), but the terminal context doesn’t get passed through when the terminal is in a detached window. Before I pass this to the team, let’s rule out settings.

Please test with a temporary clean profile:

cursor --user-data-dir %TEMP%\cursor-test-profile --extensions-dir %TEMP%\cursor-test-extensions

In that profile, repeat these steps:

  1. Open the terminal Ctrl+J
  2. Select some text, press Ctrl+L. Does it work?
  3. Detach the terminal into a separate window
  4. Select some text, press Ctrl+L. Does it work?

If it reproduces in the clean profile, I’ll share it with the team. If it doesn’t, it’s likely caused by settings or extensions.

About the second issue (Ctrl+L deletes text in chat), does that happen under the same conditions or independently? Can you share exact steps to reproduce?

Ran cursor with “cursor --user-data-dir %TEMP%\cursor-test-profile --extensions-dir %TEMP%\cursor-test-extensions“.

  1. Open the terminal Ctrl+J

  2. Select some text, press Ctrl+L. Does it work?
    Entered some text, presssed Ctrl+L - added text to Ai Chat and AI Chat windows disappeared

  3. Detach the terminal into a separate window

  4. Select some text, press Ctrl+L. Does it work?
    Entered some text, presssed Ctrl+L - added text to Ai Chat and AI Chat windows disappeared

    The same. Sometimes it adds text to ai chat sometimes not. But what it surely does that it toggles Ai chat window every time

    In embedded terminal i clearly see popup button “Add to Chat Ctrl+L“ and when i press it with a mouse - it just do what i need - sets that text to Ai Chat. In detached window i do not see that popup button. It would help a lot there

    image

    Also at startup i see this notification:

About the second issue (Ctrl+L deletes text in chat), does that happen under the same conditions or independently? Can you share exact steps to reproduce?

I can’t reproduce this - it happened very rarely, but it’s really annoying, and I can’t undo it with Ctrl+Z either.

Thanks for testing with a clean profile. That confirms this is a Cursor-side bug, not caused by settings or extensions.

I’ll share these findings with the team:

  1. Ctrl+L in a detached terminal is inconsistent. Sometimes the context is included, sometimes it isn’t.
  2. The “Add to Chat” button is missing in the detached terminal, even though it’s present in the embedded terminal.
  3. The keybinding triggers correctly (aichat.newchataction), but the terminal context gets lost.

For the second issue (Ctrl+L clearing text in the chat), if you can catch it and share a video or exact repro steps, please let me know.

I encountered a similar issue when using poetry shell, where shortcuts such as Ctrl + L or Ctrl + C—which normally work inside a command shell—did not function properly.

Since handing this over to Cursor was not very useful anyway (Cursor does not handle poetry shell well), I eventually developed a habit of prefixing commands with poetry run instead. However, for users who still rely on poetry shell, this could be a fairly critical issue.

That said, this is a bug I discovered quite a long time ago, and the project I am currently working on does not use Python, so I am unable to verify whether the issue still exists. You can safely assign this a low priority.