0

I'm using ssh.net in a UWP program. I am having diffixulty getting it to output a ANSI string to a richeditbox with the correct colouring as you would see using the likes of putty. The output looks like

[3;J[H[2J [38;5;93m───────────────────────────────────────[0m
[39;49;1mDietPi    [0m [90m|[0m [91m[33;49;1mUpdate available[0m 
[38;5;93m───────────────────────────────────────[0m
[39;49;1mV137[0m       [90m| RPi 2 Model B (armv7l)[0m
[38;5;93m───────────────────────────────────────[0m
[39;49;1mIP Address[0m [90m| [0m
[38;5;93m───────────────────────────────────────[0m

[90m Created by : Daniel Knight[0m
[90m Web        : http://DietPi.com[0m
[90m Twitter    : http://twitter.com/dietpi_[0m
[90m Donate     : http://goo   .gl/pzISt9 [0m
[90m DietPi's web hosting is powered by: MyVirtualServer.com[0m

[1m dietpi-launcher[0m  = All the DietPi programs in one place.
[1m dietpi-config[0m    = Feature rich configuration tool for your device.
[1m dietpi-software[0m  = Select optimized software for installation.
[1m dietpi-update[0m    = [91mRun now to update DietPi (from V137 to V143).[0m
[1m htop[0m             = Resource monitor.
[1m cpu[0m              = Shows CPU information and stats.

What are my options to get this to display correctly? Is there a way to get richeditboxes or any other element to accept ANSI strings?

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
Steve Fitzsimons
  • 3,754
  • 7
  • 27
  • 66
  • Duplicate of http://stackoverflow.com/questions/1889378/looking-for-a-usercontrol-which-supports-ansi-escape-codes? – Kenster Jan 30 '17 at 21:11
  • Some of the links are dead and the correct answer is a paid for piece of software. Should also note that my question relates to the UWP – Steve Fitzsimons Jan 31 '17 at 21:10
  • So the above is your expect outputs? What's the current outputs by your code? – Sunteen Wu Feb 01 '17 at 07:41
  • Above is the current output by the code. What i need it to do is strip the escape sequences ([1m) etc and colour correctly. I suppose my question is can this be done easily with a UWP richeditbox or is there a better way to do it? – Steve Fitzsimons Feb 01 '17 at 10:36

0 Answers0