1. Post #1
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Beautiful color codes for your terminal!

    if you don't know what SRCDS or Linux is then this is not for you.




    Lua Download: svn://svn.metastruct.org/srvaddons/unixtermcol
    Binary file download: here
    Username: anon, password: anon

    Warning: Includes a module, but is almost foolproof implementation so no worries!

    Source
    svn://svn.metastruct.org/gbins/xterm for binary module source.
    Compiling requires rgb2xterm and Source SDK and Garry's Headers among other things.

    TODO
    - Further improve coloring?

    Credits
    Valve - Easy hooking!
    Chrisaster - EngineSpew inspiration
    Trevor Woerner - rgb2xterm


    Also don't forget to check out EPOE and LuaDev for more debugging fun
    Reply With Quote Edit / Delete Reply Windows 7 Finland Show Events Winner Winner x 16Friendly Friendly x 1Useful Useful x 1 (list)

  2. Post #2
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    7,040 Posts
    hot, thanks baby
    Reply With Quote Edit / Delete Reply Linux United States Show Events Dumb Dumb x 2Optimistic Optimistic x 2Friendly Friendly x 2Agree Agree x 1 (list)

  3. Post #3
    TGiFallen's Avatar
    January 2010
    1,487 Posts
    I love you
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Friendly Friendly x 4Optimistic Optimistic x 1 (list)

  4. Post #4
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    7,040 Posts
    Just tried this on my server, works great <3
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Optimistic Optimistic x 1Informative Informative x 1 (list)

  5. Post #5
    JustSoFaded's Avatar
    December 2011
    432 Posts
    hot, thanks baby


    Also, nice this is awesome.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 2Optimistic Optimistic x 2 (list)

  6. Post #6
    Gold Member
    DrogenViech's Avatar
    December 2006
    961 Posts
    This addon is pure win, thank you
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Optimistic Optimistic x 1 (list)

  7. Post #7
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Just tried this on my server, works great <3
    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]
    Reply With Quote Edit / Delete Reply Windows 7 Finland Show Events Optimistic Optimistic x 1Funny Funny x 1 (list)

  8. Post #8
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    7,040 Posts
    [sub]PS: Didn't die while toying with the napalm although it wasn't exactly fun ;x[/sub]
    you can firebomb shit

    how is it not fun
    Reply With Quote Edit / Delete Reply Linux United States Show Events Optimistic Optimistic x 1Agree Agree x 1 (list)

  9. Post #9
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Made this beta compatible as much as I could, still need this request filled or can't recolor errors:
    http://facepunch.com/showthread.php?t=1206834
    Rate that post agree, 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!
    Reply With Quote Edit / Delete Reply Windows 7 Finland Show Events Friendly Friendly x 1 (list)

  10. Post #10
    garry's Avatar
    September 2001
    12,267 Posts
    I'll build this into GMod13 if you want? This is what I have for it to work on the windows console:

    Reply With Quote Edit / Delete Reply Windows 7 Show Events Winner Winner x 6Agree Agree x 1 (list)

  11. Post #11
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Guess integrating it wouldn't be too bad, but I still need the spew function for EPOE

  12. Post #12
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    7,040 Posts
    I'll build this into GMod13 if you want? This is what I have for it to work on the windows console:

    you kinda rock garry
    Reply With Quote Edit / Delete Reply Windows 8 United States Show Events Agree Agree x 4 (list)

  13. Post #13
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Oh and also:

    "Note that not all terminals support this; if color sequences are not supported, garbage will show up."

    Disable by default if you embed it.
    Alternatively check the TERM environment variable at least.

  14. Post #14
    godlike's Avatar
    September 2010
    492 Posts
    Does this work in windows?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 8Winner Winner x 2Lua King Lua King x 2Funny Funny x 1 (list)

  15. Post #15
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    I thought garry added colors for windows.
    If you want improvement to the terminal though use this: http://didrole.com/SourceCurses/

    Edited:

    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 EPOE, but I'll still try to get Garry give us SPEW_WARNING...

  16. Post #16
    Gold Member
    Map in a box's Avatar
    July 2009
    10,575 Posts
    You fixed enginespew for beta?

  17. Post #17
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Yes, or rather pretty much recompiled with backwards_headers, look in EPOE to grab the bins or here.

    Edited:

    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.
    Reply With Quote Edit / Delete Reply Windows 7 Finland Show Events Winner Winner x 1Useful Useful x 1 (list)

  18. Post #18
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Some changes

    Thanks to BlackAwps, MsgC is now finally supported (as well as it can be under ANSI colors).
    Note: Original MsgC is not called at all, but that shouldn't be a problem unless you override MsgC before this.



    Also "fixed" Garry's Mod 13 compatibility by providing autorun loader for the enum.

  19. Post #19
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Updated original post!
    Due to this 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!

    Edited:

    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.
    Reply With Quote Edit / Delete Reply Windows 8 Finland Show Events Winner Winner x 2Useful Useful x 1 (list)

  20. Post #20
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Moved location of binary code:
    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: http://g1.metastruct.org:20080/gmsv_xterm_linux.dll (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.
    Reply With Quote Edit / Delete Reply THIS BUG NEEDS FIXING, BUT I DONT KNOW WHAT CAUSES IT, SO SHUT UP AND STOP POSTING ABOUT IT. Thanks. Show Events Winner Winner x 3 (list)

  21. Post #21
    likes men
    Python1320's Avatar
    May 2007
    1,776 Posts
    Should I spend time making a true color option? https://gist.github.com/XVilka/8346728
    (Anyone using a terminal that even supports true color and which terminal is that?)

  22. Post #22

    December 2014
    78 Posts
    Beautiful color codes for your terminal!
    This thing spam my console.log with color codes. Is there any solution for this problem?
    Reply With Quote Edit / Delete Reply Windows 8.1 Chrome Russian Federation Show Events Late Late x 1 (list)

  23. Post #23
    _AMD_'s Avatar
    July 2014
    43 Posts
    The link is broken. How to download the .dll ?
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Ukraine Show Events Late Late x 3Dumb Dumb x 2 (list)

  24. Post #24
    Gold Member
    mitterdoo's Avatar
    June 2009
    732 Posts
    The link is broken. How to download the .dll ?
    metastruct.org went down, and metastruct.net took its place.
    here is the link to the lua download
    here is the link to the dll
    Reply With Quote Edit / Delete Reply Windows 10 Chrome United States Show Events Useful Useful x 1 (list)