wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
459 stars 96 forks source link

selective package loading in terminal vs wxmaxima #1902

Closed QMeqGR closed 3 months ago

QMeqGR commented 3 months ago

Sometimes I use maxima in a terminal for simple calculations. When I do I like to adjust the input and output colors by putting the following in my maxima-init.mac:

load("alt-display.mac")$
cs(s) := printf(false,"~a[~am",ascii(27),s)$
set_prompt(prefix,cs("1;36"),suffix,cs("0;36"),
                general,cs("0;93"),epilog,cs("00;"));

But this conflicts with wxmaxima when it gets loaded. Is there a way I can tell wxmaxima not to load this code?

daute commented 3 months ago

First idea: Maxima knows the command line parameter --init-mac=<filename>. You can configure wxMaxima (Configuration -> Maxima -> Additional parameters for Maxima) to tell Maxima that it should use another (maybe empty) file instead, when it is called as a wxMaxima subprocess.

Second idea: wxMaxima set the Maxima variable maxima_frontend to wxMaxima. Check this variable in your maxima_init.mac and do your settings only, if the variable does not have this value.

Best regards, Wolfgang

QMeqGR commented 3 months ago

Thanks! The first idea works (but it's --init=<filename>).