Re: mouse to move the cursor?
Roman Perepelitsa <[email protected]> Tue, 10 Feb 2026 21:08:23 +0100
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <CAN=4vMou6G-b6BjJLoRzOyR6buwph_sD39___ST6tJ9q754J5w@mail.gmail.com> |
On Tue, Feb 10, 2026 at 5:09 PM Ray Andrews <[email protected]> wrote: > This might sound outright heretical and it probably is, still ... would it > be possible to be able to use the mouse to position the cursor within a > command line? Since most everything is now mouse-capable, out of habit I > often find myself clicking on a recalled zsh command line to position the > cursor. Of course it doesn't work, but *could* it work? I'd expect it to > be viewed as a silly luxury even if it was doable, but I'll mention the > idea anyway. If that kind of thinking was acceptable one might even > contemplate various other mousey things, like maybe the scroll wheel > activating command recall or being able to dedicate left and right clicks > to assigned widgets or commands ... could get interesting. > Most modern terminals can report mouse click positions if you ask them to. You can try running one of the mouse-aware programs and see if they react to mouse clicks. One of these programs is fzf. zsh comes with zsh/curses module that supports mouse, too. You could use it to enable mouse events -- with a dash of black magic to handle mouse clicks in zle, you could achieve your goal (not sure if this is possible but it sounds plausible). If you do that, you would have to use shift-click instead of plain click to select text. This can be annoying if you select text in the terminal often. Roman