Hey everyone! I've run into an issue when trying to run a simple "Hello, World!" application in C# using the command `dotnet run`. Instead of just seeing the output, my terminal gives me these notifications: "4;0;" and "4;3;". I'm fairly new to C#, and I don't think the code should be a problem since it's just `Console.WriteLine("Hello, World!");`. I'm using Ubuntu 24.04 with the Hyprland desktop environment and my terminal is Kitty. I couldn't find much info online, and I'm a bit skeptical about chatbot answers. After fiddling around, I managed to silence those messages by adding `export DOTNET_NOLOGO=1` to my zshrc, but I'm still confused about the root cause. From what I gathered, it seems related to how Kitty handles progress reporting and malformed escape sequences. Can anyone break this down for me? Thanks!
2 Answers
Yeah, I agree! That output looks like it’s more about Kitty misinterpreting the escape sequences. I don't think the messages come from .NET directly; they seem to indicate progress updates that Kitty isn't handling correctly. It's good you found a workaround with the `DOTNET_NOLOGO=1`, but it’s frustrating that .NET would throw out those malformed codes.
You might want to add a `using System;` directive at the top of your code. You can check the official documentation on `Console.WriteLine` for pointers. I’ve worked with C# on Windows before, and typically, that directive is needed before calling method from the System namespace. But this seems to be more of a terminal issue related to Kitty's rendering of output rather than the code itself.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically