Giter Club home page Giter Club logo

Comments (8)

Mirppc avatar Mirppc commented on August 29, 2024

it is already possible. gpm is one of the dependencies. most distros disabled the sevice.

from twin.

RealSuperRyn avatar RealSuperRyn commented on August 29, 2024

it is already possible. gpm is one of the dependencies. most distros disabled the sevice.

I already have GPM enabled on my system. The issue is that my mouse inputs aren't detected by the applications in the terminals. If i open Midnight commander in my TTY, I can click, say for example a folder, and it'll select it, but if I open Twin, open an instance of Twin Term, and open Midnight commander in there, that functionality is lost.

from twin.

Mirppc avatar Mirppc commented on August 29, 2024

This was an issue with YAST on my Opensuse machines where if i opened YAST via a TTY/SSH session running twin i would lose GPM. Right now i seem to be having more issues building the latest version so i will have to get back to you after i get a build going and do some testing.

from twin.

cosmos72 avatar cosmos72 commented on August 29, 2024

GPM is needed for mouse support when running mouse-aware programs (including twin) directly on the Linux console - it's not needed in other cases.

Twin terminals emulate a Linux console (plus some extra features), thus set $TERM=linux.
An actual Linux console does not "natively" support mouse: when running inside it, programs need to manually connect to a dedicated GPM daemon to receive mouse events.
Instead Twin terminals natively support mouse, i.e. they also provide xterm-style mouse events - if a program enables them by sending the appropriate escape sequences.

The problem is lots of mouse-aware programs, including Midnight Commander, check the environment variable $TERM to decide whether the terminal supports mouse or not: for $TERM=linux they do not even try to enable xterm-style mouse events.

You can try to cheat a little and manually run TERM=xterm; export TERM before running Midnight Commander - let me know if it helps.

from twin.

RealSuperRyn avatar RealSuperRyn commented on August 29, 2024

You can try to cheat a little and manually run TERM=xterm; export TERM before running Midnight Commander - let me know if it helps.

While it did "work", it ended up causing garbled output. I just remembered that the mouse drivers on the latest version aren't working, this text is from me executing htop earlier on the ubuntu release, which screwed up the top panel
whar
This hack doesn't do anything.

from twin.

Lassebq avatar Lassebq commented on August 29, 2024

Can confirm. Only applications which use xterm way of handling mouse inputs seem to work. vim and midnight commander (the only ones I know which use GPM directly) are broken and ignore mouse clicks in twin.

from twin.

cosmos72 avatar cosmos72 commented on August 29, 2024

Yes, because vim and midnight commander see the environment variable TERM=linux (twin terminals emulate a Linux console) and they immediately assume to be running directly inside an actual Linux console, thus they try to use GPM for mouse support.

As I wrote above, a possible workaround (which may not work, as xterm and linux terminals are not fully compatible), is to slightly cheat and set TERM=xterm before launching vim, midnight commander or other GPM-aware programs.

The better solution would be to search in vim and midnight commander's documentation for how to enable xterm-compatibile mouse support also when TERM is different from xterm

from twin.

Lassebq avatar Lassebq commented on August 29, 2024

Setting TERM does the trick, sorry for confusion

from twin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.