[GAP Forum] colors

Marco Costantini costanti at science.unitn.it
Tue May 11 22:12:22 BST 2004


Dear Marcus, 
the colo[u]rs were a very important feaure of gap4.3, and the lack of them 
is a bug of 4.4 that should be fixed. 
You can get the colors againg by reading the attached file. 
(Guess what does the Italian word 'lampeggiante' mean.) 
Best wishes, 
Marco 
 
 
Scrive marcus at math.uic.edu: 
 
> I'm really embarrased to be asking 
> for something so silly, but 
> in the previous release of GAP, 
> there was file called something 
> like tips.unix that had a bunch 
> of commands to cause GAP to print various 
> colors. It also had instructions 
> on saved workspaces and tab 
> completion, but these features 
> have apparently been put into  
> CreateWorkspace.sh. 
> Anyway, the colors made doing 
> algebra marginally less unpleasant. 
> Does anyone have this file, or 
> can you just tell me how to 
> get my pretty colors back? 
> -marcus 
> --  
> I used to be "with it," but then they changed what "it" was. Now, what 
> I'm "with" isn't "it," and what's "it" seems weird and scary to 
> me. It'll happen to you... 
>  
> - Grampa Simpson 
>  
> _______________________________________________ 
> Forum mailing list 
> Forum at mail.gap-system.org 
> http://mail.gap-system.org/mailman/listinfo/forum 
>  
>  
 
 
-------------- next part --------------
UsaIlColore := true;

ANSI_COLORS := ShallowCopy( UsaIlColore );

if CompareVersionNumbers( VERSION, "4.3" ) then

# prepara per usare il colore

STDOUT := OutputTextUser();;
PrintPromptHook:=CPROMPT;;
EndLineHook:=function() end;;
ColorPrompt := function(b)
  if b=false then
    Unbind(PrintPromptHook);
    Unbind(EndLineHook);
    return;
  fi;
  # my colored interface
  # we stored this above to avoid overwriting last system error with 
  # function call
  ###  STDOUT := OutputTextUser();
  # print the prompt
  PrintPromptHook := function()
    local cp;
    cp := CPROMPT();
    if cp = "gap> " then
      cp := "gap> ";
    fi;
    # different color for brk...> prompts
    if Length(cp)>0 and cp[1] = 'b' then
      WriteAll(STDOUT, "\033[1m\033[31m");
    else
      WriteAll(STDOUT, "\033[1m\033[34m");
    fi;
    # use this instead of Print such that the column counter for the 
    # command line editor is correct
    PRINT_CPROMPT(cp);
    # another color for input
    WriteAll(STDOUT, "\033[0m\033[31m");
  end;
  # reset attributes before going to the next line
  EndLineHook := function()
    WriteAll(STDOUT, "\033[0m");
  end;
end;
Unbind(PrintPromptHook);
Unbind(EndLineHook);

ColorPrompt( UsaIlColore );

fi;



if UsaIlColore and CompareVersionNumbers( VERSION, "4.3" ) then

printcolorato := function ( arg )
    Print( "\033[1m\033[33m" );
    CallFuncList( Print, arg );
    Print( "\033[0m" );
    return;
end;

printlampeggiante := function ( arg )
    Print( "\033[5m\033[33m" );
    CallFuncList( Print, arg );
    Print( "\033[0m" );
    return;
end;

printreversed := function ( arg )
    Print( "\033[7m\033[33m" );
    CallFuncList( Print, arg );
    Print( "\033[0m" );
    return;
end;

else

printcolorato := Print;
printlampeggiante := Print;
printreversed := Print;

fi;


More information about the Forum mailing list