Terminal.Gui v2 in .net 8 shows weird escape characters in windows.... #4003
Replies: 7 comments 26 replies
-
Need more info on your environment. Screen shots would help too. |
Beta Was this translation helpful? Give feedback.
-
Please provide sample of how you boot (Init etc) the driver and shutdown etc (e.g. your Program.cs file) Make sure the code you are testing does not use methods like Also please indicate which driver you are using (or if just the default, this is arg to Also indicate what terminal(s) you have tested with. |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm new with Terminal Gui so, sorry if I'm doing something wrong. My environment: Windows 11 24H2. Visual Studio 2022, .NET 8 and testing in windows with command line standard console (cmd.exe). I also tested in Linux Ubuntu and Mac (Big Sur) with the default terminal. Terminal Gui v1 is working well in three of them. I did not have to initialize console or encoding in v1, it worked right away. So I'm a bit lost in v2. I had some luck by doing this before the initialization: Console.OutputEncoding = System.Text.Encoding.Unicode; Without the Unicode or UTF8 encoding initialization, and other driver than "NetDriver", it does not work to me. I fixed the issue with above two lines but still see some weird characters in buttons and some components. Without above lines, just doing Aplication.Init(); as v1 does, it simple did not work at all. Send you attached my very little v2 starting project in case you can have a look, any advise and help will be very welcome. Thank you very much in advance. |
Beta Was this translation helpful? Give feedback.
-
Are these question mark and arrows correct? I did not see them in v1? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Those arrows indicate a button You can change the default symbols by using the In future there will be support for named character sets so you can pick maximum compatibility or pretty etc |
Beta Was this translation helpful? Give feedback.
-
I have a .NET 8 application in Terminal.Gui v1, without any driver or console encoding initialization. It works well in Windows, Linux and Mac as it is. When running in Windows, it auto selects "WindowsDriver" and looks good. In my Terminal.Gui v2 test application, if I run it letting .Init() to choose the driver, it of course selects also "WindowsDriver" but then the result is this: In v2, I have to force Init() to use "NetDriver" instead "WindowsDriver", even running under Windows. Then, by forcing "NetDriver" it looks better, not as good as v1 but is ok. Is this how is supposed to be or its just because v2 still in development? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Correct, outside Visual Studio, executed outside de IDE works well, I did not test that way. But for whatever reason it does not work well in debug mode, running inside the Visual Studio IDE, even using the same terminal application. I'm going to compile for Linux and Mac without forcing the driver and try, I guess it will work too, but I will let you know. Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I created a .net 8 console application and trying to use Terminal.Gui v2 for testing and all the test applications I did do not render windows correctly, instead I see a mix of part of the windows with escape chars messing up the console window.
I have apps with Terminal.Gui v1.18 and works well.
Any ideas of what can I be doing wrong in v2? (BTW: I need to use .net 8, not 9, just in case that is the issue)
Beta Was this translation helpful? Give feedback.
All reactions