How do I move the Windows Command Prompt cursor with the mouse?

7,651

Solution 1

Windows command prompt only support mouse for selection and menu (right click). You can move the cursor by using arrow keys.

You also can read this for moving your cursor faster.

Solution 2

Consoles can be quite a confusing topic. The short answer is that cmd.exe run from the vanilla Windows Console does not support this, but you could use a more advanced application such as ConEmu which seems to support it.

The important thing to remember is that the "Console" only refers to the GUI part. When you start a "console application" (aka text only application) such as the Command Prompt (cmd.exe), the Powershell (powershell.exe), or the non-GUI VIM for windows (vim.exe), a console window is automatically opened to allow text based interaction with the program. ConEmu even seems to implement the xterm mouse protocol (which is just an additional set of special characters sequences) so you could use the mouse to interact with VIM.

Furthermore, the old Virtual Dos Machine is still available in all 32-Bit versions of Windows, including Win 10, so DOS applications with mouse support should work out of the box.

Edit: Some Additional Information:

Disclaimer: I personally don't bother with ConEmu since cmd.exe + clink or mintty work well enough for me, nor am I very familiar with the Win32 API, caveat emptor.

Having said that, it seems that the windows text only build of VIM is perfectly capable of providing mouse support from inside the standard console, supposedly by using the Win32 API. From this we can conclude that cmd.exe could provide similar functionality and that not doing so is not a limitation of the standard windows console per se.

Share:
7,651

Related videos on Youtube

Kyle Delaney
Author by

Kyle Delaney

Updated on September 18, 2022

Comments

  • Kyle Delaney
    Kyle Delaney over 1 year

    When I click in Command Prompt, it just selects the character I click and leaves the cursor where it is. I only seem to be able to move the cursor with the keyboard. How do I use the mouse to move the cursor to where I click?

    • Kyle Delaney
      Kyle Delaney over 6 years
      I research my questions beforehand. I'm clear and concise. And still the downvotes come without explanation. Sigh.
    • Matt
      Matt over 5 years
      Agreed! Answer is below now.
  • LPChip
    LPChip over 6 years
    With exceptions of programs that actually support the mouse, which are few.
  • Pierre LAGOUTTE
    Pierre LAGOUTTE over 6 years
    I don't know, any, thank you for the information ;)
  • LPChip
    LPChip over 6 years
    The old EDIT supports mouse, but was part of MS-DOS. Any dos program can support the mouse really. But just the command prompt itself, mostly none.
  • Matt
    Matt over 5 years
    This is the answer. I had this same question. Install ConEmu Go to settings->Mouse Uncheck the box: Send mouse events to console Uncheck this to stop sending mouse events to console, mouse will be processed by ConEmu internally (text selection, for example)