How to run selected text as command in Visual Studio 2022 integrated terminal

I am talking about Visual Studio 2022 and not Visual Studio Code

How to run the selected text as command in the integrated terminal in Visual Studio 2022?

In Visual Studio 2022, I can open a command prompt terminal with Ctrl + ` as follows.

Open Terminal in Visual Studio 2022

Now I have to copy past a command to run it. Is there any keyboard short cut available.

If this had been Visual Studio Code, I first map a keyboard shortcut as follows.

Visual Studio Code keyboard mapping

Now, I can select any text and then press Ctrl + T, Ctrl + R

Run selected text in VsCode

So I am looking for something similar in Visual Studio 2022

Read more here: Source link