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

Set ttymouse to "sgr" for screen #4146

Open
xordspar0 opened this issue Mar 21, 2019 · 8 comments
Open

Set ttymouse to "sgr" for screen #4146

xordspar0 opened this issue Mar 21, 2019 · 8 comments

Comments

@xordspar0
Copy link

According to my testing, ttymouse set to "sgr" works for tmux and screen. Could we set ttymouse to "sgr" automatically when tmux or screen is detected, similar to how xterm and other terminals are detected?

@brammool
Copy link
Contributor

brammool commented Mar 21, 2019 via email

@xordspar0
Copy link
Author

That's a good question. I don't see this mentioned in tmux's documentation, but I'm trying to track down a commit where it was added.

@xordspar0
Copy link
Author

In tmux, support for SGR mouse escapes existed at least as early as tmux/tmux@67b4d5b, which was authored in 2013 and first released in tmux 1.8. Tmux 1.8 or later first appeared in Debian 8.0 "Jessie" in 2015.

Alas, SGR mouse support seems to have been added to screen in this commit only last year, and it's not in a tagged version of screen yet.

@brammool
Copy link
Contributor

brammool commented Mar 22, 2019 via email

@xordspar0
Copy link
Author

sgr support made it into a release of screen this month. It's already in Debian testing and should be in Debian 11, which will be released in a couple years. It should be in Ubuntu 20.04.

@brammool
Copy link
Contributor

Can we somehow recognize SGR support in screen is working? By the version response perhaps?

@xordspar0
Copy link
Author

xordspar0 commented Oct 10, 2019 via email

@xordspar0
Copy link
Author

tmux always returns ^[[>84;0;0c for its version 1. It doesn't use the patch level.
screen uses ^[[>83;40700;0c, where the patch level matches the version of screen 2. We can use that and check for patch level >= 40700 to enable SGR mouse support for screen, since that's the version when it was added 3.

I'll submit a patch for detecting screen's version and selectively enabling SGR mouse support. Once I figure out how to do that with tmux I'll do that as well.

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

No branches or pull requests

2 participants