Hi Kilon, On Tue, Oct 28, 2014 at 02:12:12PM +0200, kilon alios wrote:
Why not use default as I did ? why the font needs to be fixed ? I am sorry I am not familiar with fonts in pharo so much, I did not even know what bitmap font is before I joined Pharo. For me it makes more sense to use the default because then it will use what the user have chosen in pharo settings.
I am not sure that I am reading your question correctly, but the reason for selecting a fixed font rather than a proportional font is that it provides a nice display output for many of the unix command line tools. Back in the day, a terminal was a device with fixed width character displays, and programs that write to the display would often format the output data so that it would print nicely on a display or printer with fixed width character cells. The CommandShell window is a simple emulation of devices like this. It tries to use a fixed width font so that a unix utility command will display output in the expected character positions. In Squeak, TextStyle named: 'DefaultFixedTextStyle' answers a reasonable looking fixed width font, so that's what I use as the default. If no reasonable fixed font was available, I fell back on TextStyle default. The Pharo image that I am looking at now seems to answer a proportional font as its DefaultFixedTextStyle, so maybe there is something that needs to be fixed there. By the way, if you enter this in your CommandShell window, you will find that it is evaluated as a Smalltalk expression rather than as a unix shell command: $ TextStyle named: 'DefaultFixedTextStyle' a TextStyle Bitmap DejaVu Sans 7 $ That's one of the things I was trying to do with CommandShell, mix up Smalltalk expression evaluation with unix commands, and be able to mix them up in unix command pipelines like this: $ { #one. #two . #three . Smalltalk . true } ! | cat {#one. #two. #three. Smalltalk. true} $
I dont know if you noticed my reply but I did use pwd and did try to run the script with the bash command. it looks like that pwd is not in sync with what Command Shell thinks as its current working directory , actually my bash file complained that the tool tried to run the script from the path of the actual pharo image which should not be the case .
IIRC, there have been some changes made in Pharo versus Squeak that affect default working directories, possibly the image directory as opposed to the VM directory. I don't recall the details, but you may be seeing some issue related to that. CommandShell tries to start with some initial working directory, but it keeps track of its own current working directory after it has started. This works very differently on Unix and Windows, so it was necessary to keep track of it independent of what the image and/or VM were using as defaults. It may be that changes in Pharo have affected this, or maybe you are seeing issues related to OS X, I'm not sure.
By the way congratulation on your tool, I see you have put a lot of effort in it and I am impressed by the amount of code and how well its organised. I will definetly keep exploring the code and further improve it if I can :)
Thanks! It was sort of a hobby experiment, so don't expect it to be a professional grade replacement for /bin/bash ;-) Dave