Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

switch $cursor::color to IRC format if $USER is 'p6eval' #136

Open
wants to merge 1 commit into from

2 participants

@vmspb

No description provided.

@sorear
Owner

A magical value of $USER seems smelly to me. I would much prefer NIECZA_COLOR_MODE=mIRC in the environment (color codes are a widely adopted mIRC extension, not actually an IRC thing), since Niecza is already sensitive to many NIECZA_FOO environment variables. Would it be an issue if it were to use NIECZA_COLOR_MODE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 12, 2012
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/NieczaFrontendSTD.pm6
View
16 src/NieczaFrontendSTD.pm6
@@ -221,10 +221,18 @@ method check_old_cclass($) { } # NYI
# these stash entries were created in STD so they are considered to belong
# to STD, so we have to use an INIT to change them
INIT {
- $Cursor::RED = "\e[31m";
- $Cursor::GREEN = "\e[32m";
- $Cursor::YELLOW = "\e[33m";
- $Cursor::CLEAR = "\e[0m";
+# if %*ENV<COLOR_MODE> eq 'IRC' {
+ if %*ENV<USER> eq 'p6eval' {
+ $Cursor::RED = "\x[03]4" ~ "\x02\x02";
+ $Cursor::GREEN = "\x[03]3" ~ "\x02\x02";
+ $Cursor::YELLOW = "\x[03]8" ~ "\x02\x02";
+ $Cursor::CLEAR = "\x0f";
+ } else {
+ $Cursor::RED = "\e[31m";
+ $Cursor::GREEN = "\e[32m";
+ $Cursor::YELLOW = "\e[33m";
+ $Cursor::CLEAR = "\e[0m";
+ }
}
has $.lang;
Something went wrong with that request. Please try again.