0

How can I configure my sessions in a terminal window (gnome-terminal, mate-terminal, etc) to process mouse clicks? For example, to move my cursor to another part of the screen.

  • I think you can't, never heard if such feature. – GabrielaGarcia May 6 at 20:39
  • It happens automatically when I SSH into the same host, so I know it's supported in the terminal. – DByrne May 6 at 21:23
  • No, it depends on and is a feature of the client software you're using to connect. – GabrielaGarcia May 6 at 21:29
2

Individual applications (e.g. text editors) might enable mouse support. In that case they'll be notified about mouse events, and act however they wish to. For example, the application might decide to move the cursor to the click's location, or open a menu, execute some action (e.g. think of the top and bottom bars of mc), or do whatever else. You might notice that clicking in mc's file listing area moves the currently selected file to the click location, but the terminal's cursor stays down there in the command line. Only in a fraction of cases is the desired user-facing behavior to move the terminal's cursor to the click's location.

There is no generic concept of enabling mouse support, since the cursor is expected to be entirely in the application's control. If it was moved by external means (e.g. the terminal emulator moving it on its own in response to a mouse click, without the application's request) then the application's subsequent behavior is likely to be incorrect: painting things at the wrong place. There is no way to notify an application that the cursor was moved by external means.

Some terminals try to figure out the intent of the click, and send keystrokes. E.g. if they recognize that you're in your shell editing a command line, and click within that command line's area, they synthesize the corresponding number of Left or Right keypresses that will cause the shell to move the cursor there. This approach sounds pretty fragile to me, probably breaks in a lot of cases. GNOME Terminal and MATE Terminal don't have such hack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.