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

TextField unknown character sequence #3889

Open
kacperpikacz opened this issue Dec 19, 2024 · 12 comments
Open

TextField unknown character sequence #3889

kacperpikacz opened this issue Dec 19, 2024 · 12 comments
Labels

Comments

@kacperpikacz
Copy link

kacperpikacz commented Dec 19, 2024

Describe the bug
While clicking ESC & moving cursor at same time unknown character sequence is inserted into TextField.

Nuget Terminal.Gui 1.17.1

To Reproduce

using Terminal.Gui;

Application.Init();

var textField = new TextField()
{
    Width = 48,
    Height = 1,
    ColorScheme = Colors.Error
};

Application.Top.Add(textField);

Application.Run();

Screenshots

Schermopname.2024-12-19.om.10.16.42.PM.mov

Desktop (please complete the following information):
macOS Sequoia 15.2

@tznind
Copy link
Collaborator

tznind commented Dec 19, 2024

Which version of Terminal.Gui are you referencing? I.e. the nuget package version

@kacperpikacz
Copy link
Author

kacperpikacz commented Dec 19, 2024

Which version of Terminal.Gui are you referencing? I.e. the nuget package version

Latest nuget release 1.17.1

@BDisp
Copy link
Collaborator

BDisp commented Dec 19, 2024

I cannot reproduce this issue with the updated v1_develop branch. Can you please try with it? Perhaps some fix that were not yet been published to the nuget package. Don't forget to call Application.Shutdown on exit because the mouse events will echoed to the terminal.

@tznind
Copy link
Collaborator

tznind commented Dec 20, 2024

Please can you test with https://www.nuget.org/packages/Terminal.Gui/2.0.0-v2-develop.1531

This is the latest v2 package (version numbers are currently messed up on v2) see #3779

I suspect this is parsing of ansi and probably environmental.

@kacperpikacz
Copy link
Author

I cannot reproduce this issue with the updated v1_develop branch. Can you please try with it? Perhaps some fix that were not yet been published to the nuget package. Don't forget to call Application.Shutdown on exit because the mouse events will echoed to the terminal.

Same issue with v1_develop, are you trying to reproduce with Intel or Silicon based Mac?

@BDisp
Copy link
Collaborator

BDisp commented Dec 20, 2024

Intel with VM macOS Monterey. It's the only I could install on my laptop with a Windows 11 host.

@kacperpikacz
Copy link
Author

@tznind v2_develop

Naamloos.mov

@BDisp
Copy link
Collaborator

BDisp commented Dec 20, 2024

Are you sure you're calling Application.Shutdown on exit the app? Not doing that and if you're reutilizing the terminal to launch the app again will cause mouse events to echoing in the terminal.

using Terminal.Gui;

Application.Init();

var textField = new TextField()
{
    Width = 48,
    Height = 1,
    ColorScheme = Colors.Error
};

Application.Top.Add(textField);

Application.Run();

Application.Shutdown();

@tznind
Copy link
Collaborator

tznind commented Dec 20, 2024

Please try Application.UseSystemConsole = true (do this before Init).

@kacperpikacz
Copy link
Author

@BDisp thats correct. Im using Application.Shutdown()

@kacperpikacz
Copy link
Author

Please try Application.UseSystemConsole = true (do this before Init).

No issue with latest v1_develop & Application.UseSystemConsole = true

@tznind
Copy link
Collaborator

tznind commented Dec 21, 2024

No issue with latest v1_develop & Application.UseSystemConsole = true

So this is likely a bug in our driver implementation CursesDriver. But that driver is going to be discontinued soon. I always recommend NetDriver (UseSystemConsole) as it is generally much more reliable - being based on c sharp native methods e.g. Console.WriteLine instead of Curses interop.

It would be good to try different consoles e.g. iterm2 etc

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

No branches or pull requests

3 participants