goblinfactory / konsole

Home of the simple console library consisting of ProgressBar, Window, Form, Draw & MockConsole (C# console progress bar with support for single or multithreaded progress updates) Window is a 100%-ish console compatible window, supporting all normal console writing to a windowed section of the screen, supporting scrolling and clipping of console output.
719 stars 62 forks source link

Konsole.Writer.MoveBufferArea throws System.PlatformNotSupportedException on Nix Platforms #80

Closed Evelios closed 3 years ago

Evelios commented 3 years ago

I'm running into the exception System.PlatformNotSupportedException when running on linux. Through some sleuthing I discovered your stack overflow case Is there any way to set the left and right margin of a console using Terminal sequences? the same way we can currently set Top and Bottom?. From your issue it is not clear if you found an acceptable answer to your question. This also could be a duplicate of issue #30. I am compiling and running using .Net Core 3.1. If it is relevant am running the mate terminal and also need to support xterm for my users.

Relevant stack trace.

Unhandled exception. System.PlatformNotSupportedException: Operation is not supported on this platform.
   at System.ConsolePal.MoveBufferArea(Int32 sourceLeft, Int32 sourceTop, Int32 sourceWidth, Int32 sourceHeight, Int32 targetLeft, Int32 targetTop, Char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
   at System.Console.MoveBufferArea(Int32 sourceLeft, Int32 sourceTop, Int32 sourceWidth, Int32 sourceHeight, Int32 targetLeft, Int32 targetTop, Char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
   at Konsole.Writer.MoveBufferArea(Int32 sourceLeft, Int32 sourceTop, Int32 sourceWidth, Int32 sourceHeight, Int32 targetLeft, Int32 targetTop, Char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
   at Konsole.ConcurrentWriter.MoveBufferArea(Int32 sourceLeft, Int32 sourceTop, Int32 sourceWidth, Int32 sourceHeight, Int32 targetLeft, Int32 targetTop, Char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
   at Konsole.Window.ScrollDown()
   at Konsole.Window.WriteLine(String text)
   at Konsole.Window._write(String text)
   at Konsole.Window.Write(String text)
   at Konsole.ConcurrentWriter.Write(String text)
goblinfactory commented 3 years ago

Hi @Evelios

I feel your pain, unfortunately there's some work that has to be done before this can be fixed. This is essentially a duplicate of #30

i.e. the goal is to do important API refactors in version 7, new Input features in version 8, (keyboard handlers, maybe mouse support), and cross platform support in version 9.

Let me know your thoughts?

txs,

Alan

goblinfactory commented 3 years ago

btw you can work around some problems with scrolling by changing how your code writes with Konsole, if you want to keep using Konsole. Set the window to Clip instead of scroll. So you can use Konsole to open a small window at location X, Y and have a progress bar in the window, print some status updates etc, use printAt to print at specific locations, benefit from being threadsafe etc.

Evelios commented 3 years ago

Thank you for your guidance, I'll close this issue as a duplicate to help you keep your plate clean

goblinfactory commented 3 years ago

thanks for taking the effort to report your concern. I hope to have a feature for this out quite soon, as a priority.