Advertisement
Guest User

gmqcc colors

a guest
Oct 20th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.23 KB | None | 0 0
  1. [00:25:00] <terencehill> graphitemaster: btw I have another issue, maybe depending from gmqcc, not sure. In mingw color codes are screwed up, they seem uncomplete ←[0;36mhud.qc:4451:0: ←[0;31merror: ←[0mexpected operator or end of statement
  2. [00:25:18] <@Samual> terencehill: graphitemaster: I have that same problem
  3. [00:25:21] <@Samual> graphitemaster doesn't seem to care
  4. [00:25:28] <@Samual> but it should be fixed
  5. [00:25:30] <terencehill> ffs.... :/
  6. ....
  7. [00:32:14] <graphitemaster> thats because your console doesn't support ASCI color escape sequences
  8. [00:32:23] <graphitemaster> you must be using cmd.exe or some ugly shit
  9. [00:32:30] <graphitemaster> just call gmqcc with -nocolor to disable it
  10. [00:32:45] <graphitemaster> note, there is no easy way to 'determine' if the terminal supports color, EXPECIALLY on windows.
  11. [00:33:03] <graphitemaster> so there is either a, always assume no color on windows (which is what I do iirc)
  12. [00:33:38] <graphitemaster> on linxu it's easier but also requires additional libraries which I don't want to depend on.
  13. [00:33:54] <graphitemaster> On linux I always assume color. I can't think of a console that doesn't support color on linux.
  14. [00:34:16] <graphitemaster> If you're one of those people then again -nocolor will turn it off.
  15. [00:34:37] <graphitemaster> *ASCII
  16. [00:35:06] <graphitemaster> This is documented in the man pages and the website.
  17. [00:35:26] <graphitemaster> If you're experiencing colors on windows in cmd.exe then there is something wrong with gmqcc.
  18. [00:35:52] <graphitemaster> but if you're using cmd.exe in windows to begin with then there is something wrong with you.
  19. [00:37:04] <graphitemaster> On windows there is the WinAPI route to doing colors. I'm just not all that 'into' it.
  20. [00:39:55] utack [~utack@mnch-5d875a27.pool.mediaWays.net] è entrato in #xonotic
  21. [00:46:27] dimaursu16 [~dimon@host-static-109-185-145-246.moldtelecom.md] è uscito da IRC: Ping timeout: 245 seconds
  22. [00:46:45] <terencehill> graphitemaster: I can see colors in my console, they are broken only in the gmqcc output. Is it normal?
  23. [00:47:05] <@Samual> graphitemaster: you're really using the wrong method for colors I think
  24. [00:47:18] <@Samual> graphitemaster: applications like VIM and such handle colors perfectly fine
  25. [00:47:27] <@Samual> you should use a more standard way to do it probably
  26. [00:48:05] <+xonotify> git: samual@xonotic-data.pk3dir.git/: [samual/combined_updates] Samual Lenks * 62d9700762e0 qcsrc/menu/xonotic/dialog_settings_input.c: Redisplay the menu when selecting input type
  27. [00:48:59] <graphitemaster> terencehill, what console do you use, which os?
  28. [00:49:05] <@Samual> graphitemaster: we both use the default install of msys
  29. [00:49:16] <graphitemaster> what console is that
  30. [00:49:55] <graphitemaster> according to google it's just a windows command shell window.
  31. [00:50:00] <graphitemaster> which is why those colors are not working.
  32. [00:50:11] <graphitemaster> vim and others work because they use the WinAPI method of doing colors
  33. [00:50:19] <@Samual> It's some specialized version of cmd.exe I guess, it works quite well relatively
  34. [00:50:23] <graphitemaster> this is part of libncurses clever amount of fuckery to get there.
  35. [00:50:36] <graphitemaster> and I'm not adding libcurses as a dependency to gmqcc.
  36. [00:50:46] <@Samual> graphitemaster: git and a bajillion other binaries also have proper colors
  37. [00:50:51] <@Samual> I don't think you need libncurses
  38. [00:50:56] <@Samual> I think you just need to not suck
  39. [00:51:00] <terencehill> cmd.exe surely doesn't support those color codes, mingw does
  40. [00:51:29] <terencehill> or whatever is the right name of this console
  41. [00:51:41] <@Samual> graphitemaster: These color codes you use only support bash
  42. [00:51:45] <@Samual> graphitemaster: It's not standard
  43. [00:51:46] <graphitemaster> git depends heavily on gnu utilities to do it.
  44. [00:51:48] <graphitemaster> no
  45. [00:51:50] forseti- [~forseti@189.135.22.159] è entrato in #xonotic
  46. [00:51:55] <graphitemaster> THEY ARE STANDARD ASCII ESCAPE SEQUENCES
  47. [00:52:02] <graphitemaster> it's defined in ASCII standard for christ sake
  48. [00:52:10] <graphitemaster> windows doesn't support it because windows sucks major balls.
  49. [00:52:43] <@Samual> no, pretty sure these colors are also not supported on non-bash shells
  50. [00:52:53] <@Samual> as it doesn't work on the centos server I use
  51. [00:52:57] <graphitemaster> look I've read the ansii standard.
  52. [00:52:58] <@Samual> (which doesn't use bash)
  53. [00:53:00] <graphitemaster> *ascii
  54. [00:53:09] <graphitemaster> so you're wrong I'm right, by default.
  55. [00:53:11] <@Samual> graphitemaster: sure, it likely ignores the escape sequences in that case
  56. [00:53:14] <graphitemaster> because I've actually read the standard.
  57. [00:53:17] <@Samual> but the colors don't work
  58. [00:53:18] <@Samual> that's my point
  59. [00:53:30] <graphitemaster> They don't work because cmd.exe doesn't support them.
  60. [00:53:36] <@Samual> no, i'm talking about normal shells
  61. [00:53:39] <graphitemaster> vim and other utilities use termcap/curses to achieve the right result.
  62. [00:53:54] <graphitemaster> the normal shell you speak of either a) doesn't suport them or b) has support for it off by default.
  63. [00:54:26] <@Samual> on centos the colors do not work in gmqcc, but works fine with git and vim and such
  64. [00:54:36] <graphitemaster> export $TERM
  65. [00:54:37] <@Samual> because it does not use bash
  66. [00:54:37] <graphitemaster> please on centos
  67. [00:54:52] <graphitemaster> THE SHELL INTERPRETER HAS NOTHING TO DO WITH COLOR SUPPORT
  68. [00:55:00] <graphitemaster> it's the terminal emulator
  69. [00:55:00] <terencehill> MSYS, a contraction of "Minimal SYStem", is a Bourne Shell command line interpreter system. Offered as an alternative to Microsoft's cmd.exe, .....
  70. [00:55:23] <graphitemaster> echo $TERM for me
  71. [00:56:21] <@Samual> xterm
  72. [00:56:23] <graphitemaster> run ls --color too
  73. [00:56:35] <@Samual> works fine
  74. [00:56:37] <@Samual> (shows color)
  75. [00:56:40] <terencehill> cygwin for me
  76. [00:56:47] <graphitemaster> export TERM=xterm-color
  77. [00:56:51] <graphitemaster> now run gmqcc
  78. [00:56:54] <@Samual> wtf you're using cygwin terencehill?
  79. [00:56:56] <bencoh> quite not the same ting, but ...
  80. [00:56:58] <terencehill> works fine for me
  81. [00:57:11] <terencehill> it seems so
  82. [00:57:17] <@Samual> standard installs don't work with cygwin
  83. [00:57:22] <@Samual> that's why we say "don't use it"
  84. [00:57:23] <graphitemaster> or xterm-256color for term
  85. [00:57:26] <@Samual> if something breaks, you deal with it :P
  86. [00:57:31] <graphitemaster> anyways xterm by default doesn't enable color support.
  87. [00:57:40] <graphitemaster> termcap will change the terminal to color mode implicitly if it thinks it can do it.
  88. [00:57:42] <terencehill> ah maybe because I installed msysgit long time ago
  89. [00:58:08] <@Samual> graphitemaster: this doesn't change the fact that if gmqcc wants to do colors, it should do them the proper way
  90. [00:58:17] <@Samual> graphitemaster: or it should detect that the shell doesn't support it, and auto disable
  91. [00:58:19] <graphitemaster> this is the proper way to do colors.
  92. [00:58:23] <@Samual> no, it's not
  93. [00:58:25] <@Samual> CLEARLY it's not
  94. [00:58:29] <graphitemaster> it's impossible to detect the shell without scanning the processes memory
  95. [00:58:39] <graphitemaster> termcap has a 25MB database of capailities I'd have to ship with gmqcc
  96. [00:58:43] <graphitemaster> and a 18MB library
  97. [00:58:52] <graphitemaster> so if you want that solution, you can have it
  98. [00:59:02] <graphitemaster> I don't though
  99. [00:59:07] <graphitemaster> termcap is never the right way.
  100. [00:59:23] <graphitemaster> http://en.wikipedia.org/wiki/Termcap
  101. [01:00:01] <graphitemaster> I shudder at the idea.
  102. [01:00:11] <graphitemaster> Really there is only two ways to do colors right in terminal applications
  103. [01:00:18] <graphitemaster> 1: depend on termcap or curses to do it for you
  104. [01:00:35] <graphitemaster> 2: just implicitly assume everyone has a ANSII color supporting terminal emulator
  105. [01:00:48] <graphitemaster> #2 is hard to justify because people use shit software still.
  106. [01:01:03] <graphitemaster> go use urvxt or something better instead of cmd.exe.
  107. [01:01:04] <graphitemaster> or use -nocolor
  108. [01:01:06] <graphitemaster> it's that easy.
  109. [01:01:42] <graphitemaster> or
  110. [01:01:59] <@Samual> http://stackoverflow.com/questions/6216339/mingw-msys-shell-colors
  111. [01:02:31] <graphitemaster> "Though i'll point out that I still haven't figured out how to get an arbitrary program to switch the terminal into the correct mode to interpret the color signals. Currently to make my unit tests print out all pretty I have to pipe the command through cat, for example"
  112. [01:02:39] <graphitemaster> yes, so I need to pipe everything through cat in gmqcc now?
  113. [01:02:42] <graphitemaster> give me a break.
  114. [01:02:53] <graphitemaster> it's literally horrific
  115. [01:03:10] <@Samual> I'm telling you that this is broken and should be fixed in some way
  116. [01:03:10] <graphitemaster> there simply isn't a way to switch it into interpreting color codes without tons of fuckery.
  117. [01:03:18] <@Samual> and if it's not fixed, then we'll just disable colors for all users
  118. [01:03:19] <graphitemaster> it's unfixiable without a library or lots of code.
  119. [01:03:22] <@Samual> as it is broken for some
  120. [01:03:33] <graphitemaster> those 'some' people are the issue
  121. [01:03:40] <graphitemaster> they're using broken non conforming ansi terminals.
  122. [01:03:48] <@Samual> the entirety of Windows users cannot get colors working with gmqcc
  123. [01:03:51] <@Samual> unacceptable
  124. [01:03:52] <graphitemaster> I'm not breaking any rules. I'm following a STANDARD.
  125. [01:04:07] <graphitemaster> windows isn't. I'm correct windows isn't.
  126. [01:04:08] <Ablu> lets all follow the FHS on windows
  127. [01:04:10] <graphitemaster> It's as simple as that.
  128. [01:04:29] <graphitemaster> Microsoft REMOVED support for it since XP
  129. [01:04:34] <graphitemaster> they removed it after Windows 98 iirc
  130. [01:05:07] <graphitemaster> you can get it back if you copy a ANSI.SYS into your driver folder form a Windows 98 install CD ;)
  131. [01:05:13] <graphitemaster> I shit you not.
  132. [01:05:21] <graphitemaster> but I doubt that works on modern windows
  133. [01:05:49] <graphitemaster> You can disable color if you want by default.
  134. [01:05:58] <graphitemaster> I don't really care, you're hurting users when you do that though.
  135. [01:06:53] MrBougo [~MrBougo@xonotic/contributor/MrBougo] è uscito da IRC: Quit: WeeChat 0.4.2
  136. [01:07:12] <graphitemaster> https://www.liferay.com/web/igor.spasic/blog/-/blogs/enable-ansi-colors-in-windows-command-prompt
  137. [01:07:22] <graphitemaster> http://softkube.com/blog/ansi-command-line-colors-under-windows/
  138. [01:07:26] <graphitemaster> use one of these if you have to.
  139. [01:07:58] <graphitemaster> http://stackoverflow.com/questions/16755142/how-to-make-win32-console-recognize-ansi-vt100-escape-sequences
  140. [01:08:08] <graphitemaster> http://en.wikipedia.org/wiki/ANSI_escape_code#Windows_and_DOS
  141. [01:08:28] <@Samual> but that's another dependency which needs to be done, and it's not as reliable as just using curses as it doesn't support the other shells which also reject ANSI color codes
  142. [01:08:31] <@Samual> so, no
  143. [01:08:56] <graphitemaster> look. I'm not adding curses or termcap to gmqcc.
  144. [01:09:01] <graphitemaster> I have to go play a game of cards now.
  145. [01:09:04] <@Samual> then i'm disabling color support in gmqcc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement