14

What I'm looking for is how to configure the terminal so that it behaves like nano -m. I know that xterm inside fvwm2 running on slackware does this but neither gnome or kde does it. I have tested installing fvwm2 in Ubuntu but xterm still does not have that feature.

3
  • Why do you think this is useful? Commented Mar 26, 2012 at 6:55
  • 7
    It makes editing a little easier especially for long lines not separated by spaces where Ctrl-Arrow-Key doesn't help. Pushing the arrow key and waiting for it to get to the spot I want to edit can sometimes take a while.
    – Jim
    Commented Mar 31, 2012 at 19:14
  • It is also useful for anyone who does not know shortcut keys for editing commands in the terminal (I have used Unix terminals for years and had no idea that Ctrl+Arrow would skip between words in some). I think it is generally good for a user interface to support easily-discoverable methods of interacting, and clicking a mouse to move a cursor is probably the easiest method to discover for most users. Commented Jul 24, 2021 at 20:56

2 Answers 2

7

You can enable mouse position reporting on an X11 terminal emulator, but you need a co-operating application to read the position and act on it. The terminal doesn't do it on its own. nano obviously does it, and so do other screen-oriented applications (e.g. links).

If you're just using the command-line, this won't be very useful unless you have a mouse-tracking version of libreadline. Even then, I suspect that moving your hand off the keyboard, moving a mouse/using a trackpad, then moving back to the keyboard is slower than Meta-B or Ctrl-A.

Here's a very long list of various terminal directives, including mouse tracking on various terminal emulators.

1
  • 1
    I think this answer should be edited to remove the line about using the mouse being slower than using a keyboard shortcut that many users do not know. This sentence does not help answer the question, could distract some readers from the relevant information, and could serve to drive users away from Unix because the community appears to not recognize that not all users know what they know. Commented Jul 24, 2021 at 21:01
2
echo -e "\e[?1000;1006;1015h" # Enable tracking

Script : I made a bash script to move bash readline cursor on mouse click on my github

Details : Read my answer in another post

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .