Simplest customization of MacOS zsh prompt with git branch name without escape codes

In my previous zsh configuration that I combined from multiple sources there’s an issue with backspace when moving back through a longer line. The cursor jumps up or down a line and behaves weirdly.

From some searches online, it appears I have an issue with the escape codes not starting and ending correctly. Rather than spending time debugging what’s going on, I simplified it to avoid using the escape codes using suggestions in this question:

function parse_git_branch() {
    git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}

setopt PROMPT_SUBST
export PROMPT='%n %~ %F{green}$(parse_git_branch)%F{reset_color} > '

This approaches uses the built in color codes, e.g. $F{green} instead of using the escape codes that need to be correctly terminated.

UTM frontend for QEMU for M1 Apple Silicon: Installing Windows 95

QEMU is an emulator for a wide range of machine architectures. I’ve played with QEMU on MacOS before to install and run Solaris on SPARC. It turns out there a QEMU build for Apple silicon M1, and there’s also a gui frontend to help with the configuration of various machines, called UTM.

Is there any CPU architecture that QEMU does not emulate? This is pretty amazing:

Let’s take a go at emulating an x86 32bit and install Windows 95. I added 3 drives, floppy (to boot from install disk image), a CD-ROM (for the install ISO) and a 4GB drive to install to:

Here’s where you add the disk images, and a summary of the other settings:

On first boot I got this error:

Doing some searching online it’s not immediately obvious if this is a configuration issue or a bug in UTM. One of the comments here does mention that the hdd disk image needs to be first (even though the dialog says the listed order is the boot order). I added the disks in this order and this seems to work:

While in the settings I also notice if you check the ‘advanced’ checkbox there’s options to turn of UEFI boot as that wouldn’t have been on PCs of this era, and changed the CPU to a 486:

Adding a blank 4GB disk image, a Windows 95 boot floppy image, the iso image for install cdrom, and then starting up, we can boot to a DOS prompt and start fdisk to format the blank disk image:

This works for the first time, but after you’ve formatted the blank disk image, booting a subsequent time fails with a ‘no operating system’ error. To get around this (because it won’t start unless the hd image is first), press Escape as soon as you get the BIOS screen and then you can select the boot device. In this case pick the floppy drive.

And now we’re away:

Select 1 for the NEC cdrom driver. At this point the cd iso should be on d: and c: should be your hdd disk image. If you try and run d:\setup.exe you’ll be reminded that fdisk doesn’t format your disk, you you need to format c: as well before you can install, otherwise you’ll see:

Rerun d:\setup.exe after format completes and now scandisk starts up:

Windows 95 setup is running – yes you can install x86 based OSes under UTM/QEMU on Apple Silicon!

Remember Active Desktop?

Installing Maven tool support in vanilla Eclipse IDE

If you download an Eclipse bundle like the Eclipse IDE for Java EE developers, you’ll get Maven support built in, but if you download a vanilla Eclipse install (like from using from of the daily builds), you’ll need to install many pllugins yourself.

Eclipse support for Maven is provided via the m2Eclipse plugin, there are installation instructions here:

I’ve had luck using these installer buttons before, but on this daily build for M1 they don’t seem to do anything. Instead I used the manual approach by adding a new ‘site’ in ‘Add New Software, ‘ adding https://download.eclipse.org/technology/m2e/releases/latest/ and then selecting ‘Maven Integration for Eclipse’ :

Done!