Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alacritty support? #94

Closed
agoodfellow123 opened this issue Aug 25, 2023 · 3 comments
Closed

Alacritty support? #94

agoodfellow123 opened this issue Aug 25, 2023 · 3 comments
Assignees

Comments

@agoodfellow123
Copy link

Hello, I can briefly remember twin with mouse support working fine on Alacritty before. However in my new setup I have realized that twin on Alacritty with mouse support doesn't work. I'm on Arch so this might be a new issue Alacritty just introduced,

Here is the usual error report:

twin: starting display driver module `hw_tty'...
      linux_InitVideo() failed: terminal `alacritty' is not `linux'.
      GPM_InitMouse() failed: terminal `/dev/pts/25'
      is not a local linux console.
      xterm_InitMouse() failed: terminal `alacritty' is not supported.

        ALL  MOUSE  DRIVERS  FAILED.

From the error, I can see that Alacritty is not supported both for mouse and graphics (Although it still works without mouse but looks abismal) and twin is looking for an xterm. I'm assuming my memory is misleading me, regardless support for Alacritty would be much appreciated.

@cosmos72 cosmos72 self-assigned this Aug 28, 2023
@cosmos72
Copy link
Owner

Hello @agoodfellow123,
as far as I remember, there's no standard mechanism to programmatically detect whether a terminal supports mouse or not.

Currently, twin checks if the environment variable $TERM is either linux, xterm or some known xterm-like variant (rxvt or Eterm).

You can easily add alacritty to the checks in twin/server/hw/hw_tty_common/mouse_xterm.h line 54 and recompile,
although a more general solution would surely be better...

Another "quick and dirty" approach that works with many terminal emulators (provided they are similar enough to xterm) is to just set TERM=xterm before starting twin.

Let me know if either solution works :)

@agoodfellow123
Copy link
Author

I am happy to report that "quick and dirty" method works perfectly! Haven't tried the compiling method but since lying about the terminal works I assume it would work as well.

@cosmos72
Copy link
Owner

cosmos72 commented Aug 28, 2023

Good :) then a slightly more long-term solution is to launch twin with

twstart --hw=tty,mouse=xterm

or

twin --hw=tty,mouse=xterm

which avoids lying about $TERM environment variable.

Note: you can get the list of supported options with

twin --hw=tty,help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants