Closed breadbyte closed 1 year ago
Try using the method for detecting docker environment and setting some arbitrary screen size manually so we can test it out. My guess it that it's gonna fix it. Eg. something like 120x300
@milutinke unfortunately Console.SetBufferSize
will not work. This call will throw:
Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
There is a similar issue reported for MacOS https://github.com/dotnet/runtime/issues/27216
With this changes I was managed to get MinecraftClietn work in container (docker-compose + portainer)
But I see another issue with logging PrintUserInput
it looks broken (or it just log binary) here is snippet
Two questions:
@milutinke unfortunately
Console.SetBufferSize
will not work. This call will throw:Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
There is a similar issue reported for MacOS dotnet/runtime#27216
With this changes I was managed to get MinecraftClietn work in container (docker-compose + portainer) Diff
But I see another issue with logging
PrintUserInput
it looks broken (or it just log binary) here is snippet MinecraftClient outputTwo questions:
1. Is anyone still interested in the solution? 2. Any insights about those Input logs, should they be fixed?
Yeah, I know, i've tried going down the rabbit hole, there is a problem after problem, I gave up on it. You can see my fork and maybe you will get some ideas.
Yeah, I know, i've tried going down the rabbit hole, there is a problem after problem, I gave up on it. You can see my fork and maybe you will get some ideas.
@milutinke Thanks for the response, but just to be on the same page, you also managed to fix the crash?
Right now I'm just trying understand why those suspicious logging statement Input: ....
appears only in portainer, I don't see them when I run it locally with docker run -it ...
Maybe you have an idea about those Input: ....
?
Yeah, I know, i've tried going down the rabbit hole, there is a problem after problem, I gave up on it. You can see my fork and maybe you will get some ideas.
@milutinke Thanks for the response, but just to be on the same page, you also managed to fix the crash?
Right now I'm just trying understand why those suspicious logging statement
Input: ....
appears only in portainer, I don't see them when I run it locally withdocker run -it ...
Maybe you have an idea about those
Input: ....
?
Yeah, we ran into the same issues. My diff: https://github.com/breadbyte/ConsoleInteractive/commit/8381eeb5ab11448f17f328cbf48b0cac91941a27
PS: Can't remember if I have done more than there is here, maybe i have but didn't commit, I do not remember.
Any insights about those Input logs, should they be fixed?
This output looks like it might be VT100 codes.
Turn these settings on in MCC, it might help.
[Main.Advanced]
EnableEmoji = false
[Console.General]
ConsoleColorMode = "legacy_4bit"
[Console.CommandSuggestion]
Use_Basic_Arrow = true
@breadbyte thanks for the support
Looks like ~Enable_Color = false
~ Display_Input = false
did the trick for me, but I don't really understand consequence of this config
From one of it I don't see anymore command which I type but I see suggestion "menu"
Anyway for my needs now it works perfectly thanks @breadbyte @milutinke
For the record: vt100_*
codes works perfectly in portainer
UPD. it was Display_Input = false
@breadbyte thanks for the support
Looks like
Enable_Color = false
did the trick for me, but I don't really understand consequence of this configFrom one of it I don't see anymore command which I type but I see suggestion "menu"
Anyway for my needs now it works perfectly thanks @breadbyte @milutinke
For the record:
vt100_*
codes works perfectly in portainer
Awesome You can open a pull request, so others can use this in docker
@milutinke sure, sorry I misunderstood your response in https://github.com/breadbyte/ConsoleInteractive/issues/9#issuecomment-1731986729
I thought you resolved the crash and have only issues with strange Input...
logs
Will prepare PR soon
If you can make a pull request with the changes, that would be great.
I've gained some motivation to continue working on MCC, so I'm planning to rewrite the entirety of the library (and hopefully migrate all the console legwork from MCC to this library, as it currently stands, MCC still does the majority of the color and vtcode work, and that should be thrown here instead) and this would be a good hotfix while I do that.
@breadbyte thanks you and all contributors for the hard work
Here is the PR #23, I'm not sure about the approach in general, but I can confirm that it works for me (tested more than 12h in a row, mostly for AFK)
Update was pushed to MCC https://github.com/MCCTeam/Minecraft-Console-Client/commit/911908bfaf79e52e5f0c586f03e903d5daf5d116
On a Docker Environment,
Console.BufferWidth
andConsole.BufferHeight
both return 0.This causes some internal math logic for cursor positioning in
InternalContext
to go awry.The fix for this is on a similar vein as #8, as .NET recognizes that the input/output is being redirected and thus requires the use of
Console.IsInputRedirected
andConsole.IsOutputRedirected
.