0

I was just wondering how the developers of git bash did the better resolution of the console and the colours of the font because as far as I know git is written in C. How could I realize these effects in C? I can't find anything specific how they made it at git. Any reading tips?

Thank you

alexfwulf
  • 199
  • 1
  • 13
  • 1
    https://learn.microsoft.com/en-us/windows/console/console-screen-buffers , https://learn.microsoft.com/en-us/windows/console/setconsoletextattribute – user253751 Jun 05 '18 at 00:29
  • 3
    The C language has no features for console colors; that's entirely an operating-system specific thing. On Unix-like systems (Linux, MacOS) it's generally done with libraries like termcap and ncurses. I know nothing about Windows. – Lee Daniel Crocker Jun 05 '18 at 00:32
  • Windows still has `conio.h` for console development. Otherwise follow @immibis comments. – Unmanned Player Jun 05 '18 at 05:36
  • Thank you, this looks really promising. Right now after including conio.h the compiler says "undefined reference to textcolor". – alexfwulf Jun 05 '18 at 08:25
  • Edit: i figured out the problem: GNU GCC is quite new so it doesn't compile conio.h really well (see [here](https://stackoverflow.com/questions/29574849/how-to-change-text-color-and-console-color-in-codeblocks)). After including rlutil.h it works. – alexfwulf Jun 05 '18 at 08:54
  • Maybe they use ANSI sequences for color. Newer Windows versions support more colors for console. – ddbug Jun 05 '18 at 15:10

0 Answers0