1

Very straightforward question. I have seen some answers on other websites about how to do it using terminal.app on Mac but I haven't seen any Ubuntu or Linux specific instructions.

Before anyone says, yes I know ctrl+right, yes I know GUIs are for dumb people like me, yes I know that it's a blasphemous thing to want to use a mouse input in the a terminal etc etc etc. /s

But if someone has a useful answer, please let me know.

If it's terminal emulator specific that is also fine. I've been using Hyper.js for most of my work but it's performance is slow and I'm looking to change to something else.

I'm also willing to install shell plugins etc if necessary(if that would even be possible to change this behavior. I don't know if it would). I am currently using zsh as my shell.

Also I enabled soft wrapping for nano by default, but using the nano -m flag does not seem to be working for me though maybe I'm missing something. I think this may be a limitation of Hyper.js though, so I'll try to do some testing elsewhere.

EDIT: Thank you for the link but gpm does not appear to be what I'm looking for. I'm looking for something that allows me to place my cursor in a different location, not something that allows me to select sections of text with the cursor. I can already do that.

  • 3
  • Do you mean to move the non-mouse cursor using the mouse? – egmont Jan 15 '19 at 22:24
  • @egmont Possibly. I'v never heard the cursor specified as a "non-mouse" cursor, but what I mean is this: Let's say I type in a super long single line command like cd projects && mkdir new-project && cd bew-project && touch item.txt item2.txt item3.txt && fzzy charts > item.txt and then I notice that I should have typed cd new-project instead of bew-project, and so I wanted to go back to that b and edit, I could do that with arrow keys, but it would be nice to me to be able to just click the b and it move. Is that possible? – Aslan French Jan 16 '19 at 00:14
  • 1
    There's the mouse pointer or mouse cursor or call it whatever you want, the one that's often shaped as an arrow or hand, and always immediately follows the mouse's movement. And there's the cursor, often a vertical bar or a rectangle, showing where you will type. Since the latter one does not normally move according to your mouse hardware (and your question is related to this one), I don't understand why anyone would call it "mouse" cursor. It's a cursor, not a mouse one. I find your usage of terms quite misleading. – egmont Jan 16 '19 at 08:33
  • @egmont oh whoops! I see what you mean now. That was a typo on my part. I'll amend my post. – Aslan French Jan 17 '19 at 02:44
  • 1
    I know it's possible in tty, since I've once installed a package that does that, which was about 3 years ago, but terminal emulators use slightly different device driver. – Sergiy Kolodyazhnyy Jan 17 '19 at 02:50

1 Answers1

1

You can place the cursor at a given a location using tput cup:

See: Posix command that moves cursor to specific position in terminal window on Unix & Linux.

Olorin
  • 3,488
  • This doesn't use the mouse though, correct? – Aslan French Jan 17 '19 at 04:17
  • No. This more a hint on what you could use if you were to write a shell plugin or similar. On xterm, for example, it seems you could detect mouse location on button press (http://www.xfree86.org/4.5.0/ctlseqs.html#Mouse%20Tracking), then you could use tput cup accordingly. Also see: https://unix.stackexchange.com/questions/35021/how-to-configure-the-terminal-so-that-a-mouse-click-will-move-the-cursor-to-the – Olorin Jan 17 '19 at 04:34