• [RELEASE] SRCDS Unix terminal colors hack (for putty)
    24 replies, posted
  • Avatar of Python1320
  • [B]Beautiful color codes for your terminal![/b] if you don't know what SRCDS or Linux is then this is not for you. [img_thumb]http://i.imgur.com/oJDMmwA.png[/img_thumb] [img_thumb]http://i.imgur.com/x2SxaRz.png[/img_thumb] [B]Lua Download[/B]: [url=svn://svn.metastruct.net/srvaddons/unixtermcol]svn://svn.metastruct.net/srvaddons/unixtermcol[/url] [B]Binary file download: [/B][url=http://g1.metastruct.net:20080/gmsv_xterm_linux.dll]here[/url] [B]Username: [/B]anon, [B]password: [/B]anon [B]Warning:[/B] Includes a module, but is almost foolproof implementation so no worries! [B]Source[/B] svn://svn.metastruct.net/gbins/xterm for binary module source. Compiling requires [URL="https://github.com/twoerner/xterm-256colour/blob/master/rgb2xterm.c"]rgb2xterm[/URL] and Source SDK and Garry's Headers among other things. [B]TODO[/B] - Further improve coloring? [B]Credits[/B] Valve - Easy hooking! Chrisaster - EngineSpew inspiration Trevor Woerner - [URL="https://github.com/twoerner/xterm-256colour/blob/master/rgb2xterm.c"]rgb2xterm[/URL] [B]Also don't forget to check out [URL="http://www.facepunch.com/threads/1145218"]EPOE[/URL] and [URL="https://github.com/metastruct/luadev"]LuaDev[/URL] for more debugging fun[/B]
  • Avatar of JustSoFaded
  • [QUOTE=Banana Lord.;34897344]hot, thanks baby[/QUOTE] [img]http://www.facepunch.com/fp/ratings/rainbow.png[/img] Also, nice this is awesome.
  • Avatar of Nafrayu
  • This addon is pure win, thank you [IMG]http://i.somethingawful.com/forumsystem/emoticons/emot-allears.gif[/IMG]
  • Avatar of Python1320
  • [QUOTE=Banana Lord.;34898859]Just tried this on my server, works great <3[/QUOTE] Woo, something that didn't break when I just tossed it there! [sub]PS: Didn't die while toying with the napalm although it wasn't exactly fun ;x[/sub]
  • Avatar of lorde banana
  • [QUOTE=Python1320;34911544][sub]PS: Didn't die while toying with the napalm although it wasn't exactly fun ;x[/sub][/QUOTE] you can firebomb shit how is it not fun
  • Avatar of Python1320
  • Made this beta compatible as much as I could, still need this request filled or can't recolor errors: [url]http://facepunch.com/showthread.php?t=1206834[/url] Rate that post [I]agree[/I], or make and print a poster and glue it next to Garry's office or whatever to get it fixed. PS: The newline bug is fixed (should be) in beta only!
  • Avatar of garry
  • I'll build this into GMod13 if you want? This is what I have for it to work on the windows console: [img]http://puu.sh/Xp6G[/img]
  • Avatar of Python1320
  • Guess integrating it wouldn't be too bad, but I still need the spew function for [URL="http://facepunch.com/showthread.php?t=1145218"]EPOE[/URL]
  • Avatar of lorde banana
  • [QUOTE=garry;37339813]I'll build this into GMod13 if you want? This is what I have for it to work on the windows console: [img]http://puu.sh/Xp6G[/img][/QUOTE] you kinda rock garry
  • Avatar of Python1320
  • Oh and also: "[I]Note that not all terminals support this; if color sequences are not supported, garbage will show up.[/I]" Disable by default if you embed it. Alternatively check the TERM environment variable at least.
  • Avatar of Python1320
  • I thought garry added colors for windows. If you want improvement to the terminal though use this: [url]http://didrole.com/SourceCurses/[/url] [editline]27th October 2012[/editline] Also, since Garry refuses to mark lua errors as SPEW_WARNING I have no way to make errors red, for now. I can always hook to lua_shared or do similar heuristic analysis I do in [URL="http://facepunch.com/showthread.php?t=1145218"]EPOE[/URL], but I'll still try to get Garry give us SPEW_WARNING...
  • Avatar of Python1320
  • Yes, or rather pretty much recompiled with backwards_headers, look in [URL="http://facepunch.com/showthread.php?t=1145218"]EPOE[/URL] to grab the bins or [URL="http://g.iriz.uk.to/~srcds/modules/gm13/bin/"]here[/URL]. [editline]31st October 2012[/editline] I did change one thing to make the EngineSpew hook not cause epic fail in any case. While you are in the spew no print or error triggers another spew.
  • Avatar of Python1320
  • [B]Some changes[/B] Thanks to BlackAwps, MsgC is now finally supported (as well as it can be under ANSI colors). [B]Note:[/B] Original MsgC is not called at all, but that shouldn't be a problem unless you override MsgC before this. [img]http://dl.dropbox.com/u/1910689/gmod/msgc.png[/img] Also "fixed" Garry's Mod 13 compatibility by providing autorun loader for the enum.
  • Avatar of Python1320
  • [B]Updated original post![/B] Due to [URL="https://github.com/garrynewman/gmod-module-base/issues/3"]this[/URL] bug I was forced to basically recode the thing. If you use coroutines on your server I suggest you update asap. This module is safe once more, even more so than before and also more compatible (it only detours print in lua anymore and even that is not really required). I also moved to xterm color codes so there's a whopping 256 colors to choose from when printing to console screen. Additionally MsgC is now fully supported without any detours! [editline]20th November 2013[/editline] If someone has troubles including the module it might be that you're running a too old glibc, that's my fault for updating my compiling machine but downgrading is almost impossible, sorry, you'll have to compile it yourself. I can try to provide some help or the makefile.
  • Avatar of Python1320
  • [B]Moved location of binary code: [/B] svn://svn.metastruct.org/gbins/xterm is the new location. svn://svn.metastruct.org/srvaddons/unixtermcol for the lua part for now. Might be moving everything to gbins at some point. New binary for latest GMod: [url]http://g1.metastruct.org:20080/gmsv_xterm_linux.dll[/url] (sorry for temporary link, no idea where to host all our dll files) The new GMod has threaded output so my old approach no longer works, new approach is less clean, but should work for most of the cases.
  • Avatar of Python1320
  • Should I spend time making a true color option? [url]https://gist.github.com/XVilka/8346728[/url] (Anyone using a terminal that even supports true color and which terminal is that?)
  • [QUOTE=Python1320;34895506][B]Beautiful color codes for your terminal![/b][/QUOTE] This thing spam my console.log with color codes. Is there any solution for this problem?
  • Avatar of mitterdoo
  • [QUOTE=_AMD_;50627688]The link is broken. How to download the .dll ?[/QUOTE] metastruct.org went down, and metastruct.net took its place. [url=svn://svn.metastruct.net/srvaddons/unixtermcol]here is the link to the lua download[/url] [url=http://g1.metastruct.net:20080/gmsv_xterm_linux.dll]here is the link to the dll[/url]
  • Avatar of Python1320
  • Updated OP links. Old binaries may or may not require updating to this one after the latest GMod update. Just a recompile with recent SDKs should suffice if you want to do it yourself. Also of note should be that one may want to use [URL="https://github.com/Metastruct/enum_loader"]enum_loader[/URL] for loading this addon before all other lua addons for maximum coloration on server startup.