Open franzbischoff opened 4 years ago
Compile Rcpp code that contains errors.
I realize these repro steps are "obvious", but it would be helpful if you provided us with a more concrete set of steps to reproduce -- even if that was a package (e.g. on GitHub) that we could clone + checkout some specific branch to quickly open and reproduce on build.
There it is:
Clone the repo, open in Rstudio and hit Ctrl+Shit+L, or devtools::load_all(".")
You should see this ugly format in console:
I can reproduce this on Windows 10. It is not an issue on MacOS 11.
@franzbischoff: awesome, thank you! We really appreciate your taking the time to make this easily reproducible.
FWIW, I wasn't able to reproduce at first:
I had to explicitly set:
writeLines("PKG_CXXFLAGS = -fdiagnostics-color=always", con = "src/Makevars")
to ensure colored compiler output. Were those C++ flags set by you, or do you know if they're coming from somewhere else?
Not by me.
I searched for Makevars without success on:
I found Makevars.win on C:\Program Files\R\R-4.0.3\src\library\windlgs\src\Makevars.win with this content:
PKG_LIBS=$(GRAPHAPP_LIB)
Additionally, I tried to remove as many options as I could from RStudio settings. No luck.
Plus: compiling via Rgui or R.exe, the -fdiagnostics-color=always
option is not used.
Setting this ENV turns the result slightly better (at least the error turns on red and little is deleted from the output):
Sys.setenv(GCC_COLORS='error=31:quote=')
Still, this seems to be a problem with the terminal handling colors. For e.g., MSYS terminal works fine.
System details
Steps to reproduce the problem
Compile Rcpp code that contains errors.
Describe the problem in detail
Using RStudio (stable version too) on Windows and Rstudio server on WSL (at least), the error messages have missing characters, like in this example:
using WSL:
I tried to remove options:
And I tried to change fonts: Lucida Console, Courier, Noto Mono, Consolas, Firacode.
The problem persists:
Without Show syntax highlighting in console output:
Plus without Different color for error or message output and Removing ANSI colors
Plus Ignoring ANSI colors:
Describe the behavior you expected
The expected output is in the image below, using the RGui or RConsole: