How to change font in CommandShell window in pharo or squeak?

In Pharo and Squeak, if installed, you can enter CommandShell open. , and it will open a command window, which basically looks like a “bash shell” or “terminal window”, but uses almost the default microscopic size of the default font. I can’t figure out how to change this.

I realized that the general approach in smalltalk is to look at the implementation of the class and see if you can learn something that you could tell the class to tell it what you want, or in some way you can change class so that it responds to something else for some other class, causing the desired effect. Something like anInstanceOfCommandShell someViewOrControllerThingy setDefaultFont:blahblahblah or something like that.

CommandShell seems to use ShellWindowMorph and accepts the setFont message. I am new to Smalltalk and Squeak and don't know what to do next.

I am using Pharo 2.0, but if someone knows how to do this in Squeak, I am sure that it will be about the same.

Please note that I found the pharo settings and that regular changes to the settings affect the main transcript window, but do not affect the special CommandShellTranscript or its contents.

enter image description here

The code I use to change the rest of the fonts programmatically was the answer from another question that says:

 |font codeFont| font := LogicalFont familyName: 'Consolas' pointSize: 10. codeFont := LogicalFont familyName: 'Consolas' pointSize: 9. StandardFonts listFont: codeFont. ... 
+4
source share
2 answers

You can override the default #textStyle value for ShellWindowMorph as follows:

 textStyle " Answer a font for the text morph" ^ TextStyle default 

The window should be able to install the font directly from the shell menu (arrow in the upper right corner) or from the parameter browser. You can change any morphing property by moving the "Halo" menu over the morph you are interested in (Alt + Shift + Left Click on MS Windows) and select the red icon. Then select Debug -> Explore morph and set the text style directly from Explorer:

 self textMorph setTextStyle: TextStyle default 
+5
source

ShellWindowMorph uses the system-wide DefaultFixedTextStyle.

In Squeak, you can change it as follows:

 TextConstants at: #DefaultFixedTextStyle put: (TextStyle fontArray: {StrikeFont fromUser}). 
+2
source

All Articles