Jump to content

[C# .NET] Empty void always prints a newline.

WillLTT
Go to solution Solved by Sauron,

When you press enter the program executes and does nothing - at this point your cursor is already on the new line - then the program exists and the shell generates a new prompt. You can't avoid that, it's just the way the shell works.

When you press enter the program executes and does nothing - at this point your cursor is already on the new line - then the program exists and the shell generates a new prompt. You can't avoid that, it's just the way the shell works.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Sauron said:

When you press enter the program executes and does nothing - at this point your cursor is already on the new line - then the program exists and the shell generates a new prompt. You can't avoid that, it's just the way the shell works.

Well that kind of sucks.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, WillLTT said:

Well that kind of sucks.

May I ask, what are you trying to achieve by having a program "without" the new line?  There might be other solutions to what your goal is

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/9/2020 at 1:20 AM, wanderingfool2 said:

May I ask, what are you trying to achieve by having a program "without" the new line?  There might be other solutions to what your goal is

my program has a -silent parameter, and it want it to completly dead silent, no extra newline

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/10/2020 at 10:55 AM, WillLTT said:

my program has a -silent parameter, and it want it to completly dead silent, no extra newline

Well it still should behave like that...

 

Try [program] -silent >output.txt

That will show exactly what the program is outputting.  The thing is, if you run it in command prompt and such like that; the act of calling it generates a line.  If you were to lets say call the program using [https://stackoverflow.com/questions/4291912/process-start-how-to-get-the-output] you should be getting nothing (I think...not quite sure about c#, but just tried on c++ and it works)

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×