-
Notifications
You must be signed in to change notification settings - Fork 680
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
Mouse button clicks by itself on certain Linux distro #1617
Comments
Thanks for reporting this. Can you test with the current main branch, please. I already reported some issues in this my comment #1452 (comment). |
Both my simple program and UICatalog, compiled using a clone of the current main branch have the same problem. It seems the mouse repeats the last operation:
I attach an image captured from UICatalog - Scenario: Mouse. Also in this case I clicked the mouse once. I hope this will help. |
Forcing the use of the System Console the issue does not occur. Application.UseSystemConsole = true; // now it works well on Debian 11 It may be something related to ncurses library.
|
Yes, the issue is |
Waiting for a definitive solution I added these lines to Program.cs: bool useSystemConsole = false;
foreach (string arg in Args)
{
if (arg == "-usc")
useSystemConsole = true;
}
// https://github.com/migueldeicaza/gui.cs/issues/1617
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
try
{
string release = File.ReadAllText("/etc/os-release");
if (release.Contains("debian"))
useSystemConsole = true;
if (release.Contains("ubuntu"))
useSystemConsole = true;
}
catch { }
}
Application.UseSystemConsole = useSystemConsole;
Application.Init(); |
In this case you are using NetDriver and not CursesDriver. The solution is discover the magic sequence escape that will work correctly. |
I confirm that the mouse in |
@BDisp I have
|
Thanks @tznind for the information. Is a laptop only with Ubuntu or dual boot? With the virtual |
Just Ubuntu only, its too old for Windows (but I have a soft spot for it so won't get a new one). My main dev machine is Windows. I've had it running MX Linux before and also had no problems with mouse in Terminal.gui but that was a while ago. |
Closing as not-repo |
I can reproduce this reliably on both Debian and Ubuntu, in both Gnome Terminal and xterm. Once I've clicked the mouse button once, it forever sends click events. It makes CursesDriver unusable for me. How can I help debug this? |
With the most recent |
Do the affected distros have this issue with other ncurses programs?
Do you mean that ncurses is getting 'bad' code events from the OS? If so is it possible that there is just a change in the structure of those events (e.g. similar to #2008)? Maybe we are expecting some bit code and instead getting different ones?
Could you explain more about this? It sounds like you have an idea about what is going on? What would a 'database change' look like? and why does it not affect other apps e.g. I think if we can establish clear definitions of the input code formats that we are seeing in different OS versions it wouldn't be out of the question to build in some 'mapping' classes that translate to the common representation for that version? |
I've read those that use native library with
On Debian 9.0 distro mouse move isn't caught at all and the others events doesn't match the one the Ubuntu receives. With the latest of installable versions of Ubuntu and Debian the ncurses always return always the same code event. So I already removed them. No it's having nothing with the #2008, which we receive correct code an we remap to the correct output values. The issue is we are receiving wrong code from the ncurses itself and there are no way do decode them because they are inconsistent.
I mean about the Termcap and Termunfo databases where can be configured soe keys, mouse and others information on how the terminal will respond to the commands. I don't know on what language
I think we can't establish clear definitions of the input code formats that we are seeing in different OS versions without |
Thanks for such a deep analysis. Sounds like quite a challenge. But also that there might be a solution involving picking the correct library version or indicating to the developer/user that they are running against a dependency that is missing required compile options. Should we reopen this issue or create a new one do you think? I get that this is really a problem with distros and ncurses compilation versions but it would be nice if we could at least detect at runtime the issue and either shut off the mouse completely or otherwise indicate to programmer that a dependency is missing/misconfigured. We could also just write some docs on how to get the right dependency installed on these newer distros if thats a thing that's reasonable to do. |
I agree. The docs is up to you :-). I'll continuous investigating this because I think the Debian and Ubuntu teams won't really broken the mouse features on terminals. I think you can reopen this issue. |
Thankful to this response from @DHowett in microsoft/terminal#10321 (comment), I already know how to fix this issue. |
Running this simple application on Debian 11 or Ubuntu 21 happens that the mouse clicks by itself when it is moved on a menu item or a button. Instead the program run fine on Centos 7.
To Reproduce
Using Debian 11 fresh installation I tried on VirtualBox, VMware. On Ubuntu 21.10 using a phisical machine. In all cases the issue happens.
Both Self-contained and Framework-dependent package are affected.
Below the X configuration of the Debian machine running on VirtualBox:
The simple program
The program has been wrote using VS2022, framework .NET 6.0 (6.0.2), Terminal.Gui 1.4.0
The issue occurs also on more complex programs.
Screenshots
As you can see, the mouse button clicks by itself, I never clicked the mouse button.
Thanks
Many thanks to the creators and maintainers of this useful piece of software.
I'm at your disposal for any information.
The text was updated successfully, but these errors were encountered: