You are not logged in.

#1 2021-03-28 14:20:27

nponeccop
Member
Registered: 2011-09-05
Posts: 17

Mouse in text console through xterm

I found a way to make tmux working with mouse in text mode. IMO it's better than pure gpm/consolation setup, so I wanted to share my way. It's also interesting to know if there are more straightforward ways to get the same result.

End result

ANY application supporting mouse in a xterm can use mouse in Linux console as well. Not only those specifically compiled with gpm support, such as vim. Tmux notably doesn't work with gpm but now it does let you switch panes using mouse in Linux text console.

Pros

- no need for gpm-specfic support any more - so apps such as tmux work with mouse in Linux console

Cons

- gpm-style mouse copy-paste doesn't work

Ingredients

- standard base setup
- consolation (from AUR)
- lcxterm https://gitlab.com/klamonte/lcxterm/-/tags/v0.9.1 (I'm not an author; I have a PKGBUILD if someone wants to try but it's trivial configure/make/make install)

How it works

- lcxterm plugs between agetty and bash and injects xterm mouse escape sequences

Setup to try it

- systemctl start consolation
- in a console:
  - log in
  - run lxcterm
  - run tmux with tmux set mouse on
  - open more than one tmux pane
  - switch between panes using a text mode blocky mouse cursor

vim and nvim work as well, with basic :set mouse=a setup.

What do you think? Is there a way to achieve this with less exotic components?

Note

- it's a simplified non-intrusive setup. The proper way is probably to make agetty running it.
- I tested it in Hyper-V, YMMV

Last edited by nponeccop (2021-03-28 14:26:08)

Offline

#2 2023-07-29 14:20:01

Oleg_NYC
Member
Registered: 2023-07-23
Posts: 12

Re: Mouse in text console through xterm

I wonder why lcxterm isn't available in either the AUR or the binary repositories. Sometimes people want to run tmux in the tty environment, so this tool is useful. By the way, on FreeBSD, the mouse will simply work in tmux running in the tty environment, and no additional tools will need to be installed.

Offline

#3 2023-07-29 14:41:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: Mouse in text console through xterm

Oleg_NYC wrote:

I wonder why lcxterm isn't available in ... the AUR

Because no one has submitted it.  Feel free to do so if you think it's worthwhile.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2023-07-29 17:55:38

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Mouse in text console through xterm

Oleg_NYC, this thread is two years old. Please do not necrobump.

Closing.

Offline

Board footer

Powered by FluxBB