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.

  • Why do you think this is useful? – Ignacio Vazquez-Abrams Mar 26 '12 at 6:55
  • 4
    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 Mar 31 '12 at 19:14

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.

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

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.