GithubHelp home page GithubHelp logo

Comments (7)

mklefrancois avatar mklefrancois commented on July 28, 2024

This is strange indeed and I don't see this locally.
Is this under Linux? What is the OS and compiler used?

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

Windows 10.
I try vs 2019 and mingw.
Output is same

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

seems console properties determines wrong about support ANSI escape codes for colored output

from vk_raytrace.

NBickford-NV avatar NBickford-NV commented on July 28, 2024

Hi @tigrazone ! Yes, these are ANSI escape codes; it turns out cmd.exe doesn't format these by default! (Windows Terminal and Visual Studio's Debugger Command Prompt do.) It sounds like you may have figured this out: if you create a registry key in Computer\HKEY_CURRENT_USER\Console with name VirtualTerminalLevel, type DWORD, and value 1, it should enable ANSI color codes in cmd.exe.

Here's the content of a .reg file for it:

[HKEY_CURRENT_USER\Console]
"VirtualTerminalLevel"=dword:00000001

It looks like we can also improve this on the nvpro_core side by enabling ENABLE_VIRTUAL_TERMINAL_PROCESSING using SetConsoleMode(); I'm going to look more into this.

Thanks!

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

why If on users computer there is no described record in registry is showed ←[0m like in my issue record?
Is it real to determine if ANSI escape codes is off and dont show text with escapes?
Looks like issue in determine routine

from vk_raytrace.

NBickford-NV avatar NBickford-NV commented on July 28, 2024

That would relate to the ENABLE_VIRTUAL_TERMINAL_PROCESSING approach; I'm currently looking into that.

from vk_raytrace.

tigrazone avatar tigrazone commented on July 28, 2024

I tested fix:
add after https://github.com/nvpro-samples/nvpro_core/blob/500dea27f7043bfca3e82b5e246fe5f8c946cc54/nvh/nvprint.cpp#L242

#ifdef _WIN32
    HANDLE handleOut = GetStdHandle(((1 << level) & LOGBITS_ERRORS) ? STD_ERROR_HANDLE : STD_OUTPUT_HANDLE);
    DWORD consoleMode;
    GetConsoleMode( handleOut , &consoleMode);
    consoleMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
    consoleMode |= DISABLE_NEWLINE_AUTO_RETURN;            
    SetConsoleMode( handleOut , consoleMode );
#endif

from vk_raytrace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.