-
Notifications
You must be signed in to change notification settings - Fork 588
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
System.ArgumentNullException thrown for colored console output on Mono #1355
Comments
Auto.Setting sounds great. Can you try to send a PR? 2016-08-12 20:53 GMT+02:00 Roman Provazník [email protected]:
|
Related: microsoft/vscode#9681 TL;DR: The right value to set is almost certainly |
Fix for issue #1355 : System.ArgumentNullException thrown for colored output
Well, after two accepted PRs #1355 and #1363 , I am quite desparate. Setting property on CI (ubuntu) servers still doesn´t work properly. When I try test like this: Target "TestMono" (fun _ ->
tracefn "MONO IS %b" EnvironmentHelper.isMono
tracefn "UNIX IS %b" EnvironmentHelper.isUnix
tracefn "TERM = %s" <| System.Environment.GetEnvironmentVariable("TERM")
) TERM property is set ok (inside TestMono Target) to |
I did some pretty extensive research when writing that microsoft/vscode#9681 issue, but I never found out how to change the terminfo setting from inside a process. If you're starting another process (as VS Code is with the integrated terminal) then you can set The right answer is to put something like the following in your # Work around broken gnome-terminal setting
if [ "$TERM" == "xterm" ]; then
if [ "$COLORTERM" == "gnome-terminal" ]; then
# Set a value that will let color output work properly
export TERM=xterm-256color
fi
fi However, that only works on YOUR machine, and won't work widely. (Also note that the The only thing that comes to mind is to detect this scenario (by checking the value of
And then put in the But as far as setting it correctly from within FAKE, I'm afraid you're probably hosed. I think you'll have to detect the problem, disable color if it's detected, and tell the user how to fix it by editing their |
Wow, thanks @rmunn for great explanation! Now it seems like we cannot fix this "from inside", but maybe we could just check for exception in What is your opinion about this, @forki ? |
I have no idea. Please send pr to make it work like you guys think it's Am 22.08.2016 4:26 nachm. schrieb "Roman Provazník" <
|
Hint shown in for ArgumentException #1355 instead of trying to set it directly
Ok, this is not actually FAKE`s fault, but right now I do not know where to put this important information, which could save few hours for other developer. Please, take this as something worth documenting (i can send PR, if you would hint me where to put this information):
When running FAKE on Mono (version 4.4.2) on Ubuntu 12.04/14.04, this error occures:
To fix this, you have to set environment property
SET TERM=xterm-color
! After setting this, everything works great.Maybe this environment property could be auto-set by FAKE when running on Mono (just idea).
The text was updated successfully, but these errors were encountered: