bug-bash
[Top][All Lists]
Advanced

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

Fwd: Feature: where terminal reports mouse click to bash, support positi


From: IFo Hancroft
Subject: Fwd: Feature: where terminal reports mouse click to bash, support positioning the cursor accordingly
Date: Mon, 18 Jan 2021 09:13:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1

Good point! Thank you!

I forgot to take full screen applications like Vim and such into account
and the fact that they draw to the screen themselves instead of making
the terminal to do it.

-------- Forwarded Message --------
Subject: Re: Feature: where terminal reports mouse click to bash,
support positioning the cursor accordingly
Date: Mon, 18 Jan 2021 14:01:42 +0800
From: Koichi Murase <myoga.murase@gmail.com>
To: IFo Hancroft <lists@ifohancroft.com>
CC: bash.bug list <bug-bash@gnu.org>

2021年1月18日(月) 12:32 IFo Hancroft <lists@ifohancroft.com>:
> What you want (the ability to reposition the cursor in the terminal
> with a mouse click) can be done with just the terminal itself.

I think Mike wanted to move the current text insertion point in
Readline (or, in other words, the command line of Bash) but not just
move the current cursor position in the terminal.  If the terminal
just moves its cursor position without sharing the information with
the application (i.e., Bash in this case), the result would be just
broken rendering.

So, this does have something to do with Bash or any text editors
working in terminals.  In fact, recent versions of Emacs and Vim
supports mouse using the mouse escape sequences of terminals.  A
terminal application (such as Bash or text editors) could receive from
the terminal the mouse events encoded in terminal sequences, move its
internal cursor position, render the updated text content and move
the terminal cursor position by sending escape sequences to the
terminal.

There has been some attempt to support the mouse in zsh:

https://unix.stackexchange.com/questions/444601/any-terminal-shell-with-mouse-support

but I think this implementation is not robust.  For example, I think
this doesn't work when there are wide characters in the command line
or the text content doesn't fit into a single terminal line.

Actually, there is some practical problem of supporting mouse by
shells: the shell is not a full-screen terminal application so that
it cannot handle the mouse events that occurred outside the command
line.  So, one needs to compromise with some features or integrate
something like terminal multiplexers in the shell to manage all the
terminal contents in the shell.  There were some discussions in Oil
Shell:

https://oilshell.zulipchat.com/#narrow/stream/121539-oil-dev/topic/Playing.20With.20Debuggers
https://oilshell.zulipchat.com/#narrow/stream/121540-oil-discuss/topic/non-linear.20shell.20UI

--
Koichi




reply via email to

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