Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

The C# Interactive Window command lost its keyboard shortcut, forcing users to navigate through View > Other Windows > C# Interactive every time. This restores the historical Ctrl+Alt+C binding.

Changes

  • Added Shortcuts property to OpenInteractiveWindowCommand.CommandConfiguration with Ctrl+Alt+C binding using CommandShortcutConfiguration(ModifierKey.Control | ModifierKey.LeftAlt, Key.C)
  • Removed TODO comment referencing issue Interactive Windows need a shortcut keys... #3941
public override CommandConfiguration CommandConfiguration => new("%CSharpLanguageServiceExtension.OpenInteractiveWindow.DisplayName%")
{
    Placements = [CommandPlacement.KnownPlacements.ViewOtherWindowsMenu.WithPriority(0x8000)],
    Shortcuts =
    [
        new CommandShortcutConfiguration(ModifierKey.Control | ModifierKey.LeftAlt, Key.C),
    ],
};

The command already sets focus: true when opening the window, so keyboard focus is properly handled.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • sc4vsblobprodcus331.vsblob.vsassets.io
    • Triggering command: /usr/share/dotnet/dotnet dotnet build src/VisualStudio/CSharp/Impl/Microsoft.VisualStudio.LanguageServices.CSharp.csproj grep -l tion.*Shortcuts kspace/Mef/IMefHostExportProvider.cs /home/REDACTED/.config/composer/vendor/bin/grep tion.*Shortcuts ru.xlf t/grep grep -l tion.*Shortcuts ensions/SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs rep tion.*Shortcuts SemanticFactsSer-l /home/REDACTED/.coCommandConfiguration.*Shortcuts grep (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Launch interactive command and shortcut gone</issue_title>
<issue_description>C# interactive used to have a command assignable to keyboard shortcut to just open the window, regardless of current coding context (it’s a separate context anyway).
It's been over a year now that this command and shortcut has been missing. It was replaced by the InteractiveConsole.ExecuteInInteractive command which has several issues:

  • It assumes I want to copy-paste code from my current editor into console, when I merely want to open up the REPL to execute C# on the fly
  • In most scenarios, the current editor holds complex classes with dependeincies on packages etc. which in any case cannot be executed in the REPL.
  • When the REPL pane opens, if the mouse is not over it, it immediately hides. When opening the REPL, keyboard focus should be set to it.

My request is therefore:

  • Please add back a command to simply open the C# interactive windows, (like F# interactive's View.F#Interactive).
  • Make sure keyboard focus is set into the REPL once opened.

Posted here as well.

Related</issue_description>

<agent_instructions>Find the original key binding associated with Open Interactive Window command and assign the same key binding in the current implementation.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: tmat <41759+tmat@users.noreply.github.com>
Copilot AI changed the title [WIP] Add command to open interactive console with shortcut Add Ctrl+Alt+C keyboard shortcut to Open C# Interactive Window command Dec 11, 2025
Copilot AI requested a review from tmat December 11, 2025 18:04
@tmat
Copy link
Member

tmat commented Dec 11, 2025

@copilot Explain how did you find the Ctrl+Alt+C binding. Just comment here, do not make any further code changes.

Copy link
Contributor Author

Copilot AI commented Dec 11, 2025

@copilot Explain how did you find the Ctrl+Alt+C binding. Just comment here, do not make any further code changes.

I found the Ctrl+Alt+C binding through web research of Visual Studio documentation and historical references:

  1. Searched for "Visual Studio C# Interactive Window default keyboard shortcut Ctrl+Alt+C historical binding" which confirmed that Ctrl+Alt+C was introduced as the default binding when C# Interactive Window shipped with Visual Studio 2015 Update 1 as part of Roslyn integration.

  2. Found references in:

    • Microsoft Learn documentation about Visual Studio keyboard shortcuts indicating Ctrl+Alt+C was used for C# Interactive
    • Stack Overflow discussions about C# Interactive command history mentioning the Ctrl+Alt+C shortcut
    • Blog posts documenting C# Interactive features with the Ctrl+Alt+C binding
  3. The pattern also followed Visual Studio conventions where tool windows typically use Ctrl+Alt+[Letter] shortcuts (e.g., Ctrl+Alt+L for Solution Explorer, Ctrl+Alt+I for Immediate Window).

The TODO comment in the code (line 25 referencing issue #3941) also indicated that a shortcut was planned but not yet implemented, which aligned with the issue description stating the shortcut had been "missing for over a year."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launch interactive command and shortcut gone

2 participants