How can I use Ctrl-K, Ctrl-Enter to send code to the C# Interactive window?

723 Views Asked by At

TL;DR: how can I send a selection from the C# editor to the C# Interactive window?

The C# Interactive help screen (after typing #help) shows a bunch of keyboard shortcuts, among which:

Ctrl-K, Ctrl-Enter Paste the selection at the end of interactive buffer, leave caret at the end of input.
Ctrl-E, Ctrl-Enter Paste and execute the selection before any pending input in the interactive buffer.

The first of these, Ctrl-K, Ctrl-Enter always gives:

The key combination (Ctrl+K, Ctrl+Enter) is bound to command (.InteractiveConsole.CopyToInteractive) which is not currently available.

The message suggests it is bound correctly, but it never sends anything to the C# Interactive window, regardless of me having the focus on a C# source file and an active selection.

The second command, Ctrl-E, Ctrl-Enter always shows: The key combination (Ctrl+E, Ctrl+Enter) is not a command.

How do I use this key combination (send current selection to C# Interactive) correctly? What am I missing here? Can I use a different key combination or binding?

0

There are 0 best solutions below