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

Newline / carriage return? #61

Open
martinweihrauch opened this issue Sep 16, 2020 · 3 comments
Open

Newline / carriage return? #61

martinweihrauch opened this issue Sep 16, 2020 · 3 comments

Comments

@martinweihrauch
Copy link

Thank you for writing Konsole, I really dig it!
Do you have a newline-character, which I can put into e. g. a Write or Writeline statement? \r\n does not work correctly.
Thx

@goblinfactory
Copy link
Owner

this should be added....

@goblinfactory
Copy link
Owner

goblinfactory commented Sep 20, 2020

this will definitely be added to the next version.
in the meantime you can create an extension method for yourself in the few cases you need it like this
//PSUEDO CODE ... You need to write and test something properly yourself

public static class ConsoleHelper {

public static IConsole WriteLineSpecialChars(this IConsole con, string text) { 
   text.split("`\r\n").ToList().ForEach(line=> con.WriteLine(line));
  // edit this code further to add support for other special characters you need to support.
 // remember to test to make sure your implementation works for both \n as well as \n\r
}
}

that should be easy enough.

@goblinfactory
Copy link
Owner

@martinweihrauch this is now fixed in V7-alpha or later. You can now WriteLine("line1\nLine2\rLine3");
V7-Alpha or later.
Packages are now in nuget : https://www.nuget.org/packages/Goblinfactory.Konsole/7.0.0.3-alpha

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

No branches or pull requests

2 participants