Why am I seeing “4;0;” and “4;3;” messages when running my C# app?

0
4
Asked By CoderDude92 On

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

Answered By CuriousCoder88 On

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.

Answered By TechyTommy42 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.