bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-readline] readline mouse click handling on DomTerm


From: Per Bothner
Subject: [Bug-readline] readline mouse click handling on DomTerm
Date: Mon, 1 Jan 2018 15:40:22 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

FYI: I've implemented support in the DomTerm terminal emulator 
(http://domterm.org)
for moving the cursor by clicking the mouse.  This works by Domterm calculating
the "distance" between the clicked position and current cursor position, and
sending the corresponding number of arrow-key events.

No readline changes were needed - in fact the feature works for any application
or library that maps arrow key events to cursor motion.  Since Domterm doesn't
know which programs that is, you can "enable" the feature in one of two ways:

- Set the prompt string appropriately, as specified here:
  http://domterm.org/Tips.html#bash-shell-prompt
  This enables what I call "readline mode" in the current input line.

- "Force" cursor motion mode by pressing Alt while clicking.

Wrapped lines (lines wider than the terminal width) work.

Middle-click paste also works.

Some readline alternatives (such as JLine3) have the option of enabling mouse
click reporting. However, doing so has some annoying downsides, as it disables 
(or
requires the application to handle) features such right-button context menu;
text selection; scroll button support.  I think it works much better to
only handle left clicks (and middle-button paste) in the input area,
which leaving other mouse operations to the default.

I hope you try out DomTerm - it's a pretty nice terminal emulator is other ways 
too.
--
        --Per Bothner
address@hidden   http://per.bothner.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]