I started to use it from 15.5, half a year ago, had already put it into zshrc and runs every time starting Terminal, and i always using quotes, it works fine on 15.5, after 26, it starts to give extra spaces.
You can say "Yep, it was been going on for a long time" but it doesn't mean it is not a bug.
Thank you for sharing your experience.
I have made it compatible by removing the spaces.
function mountTMP() {
if [[ ! -d "/Volumes/TMP" ]]; then
LOCKFILE="$TMPDIR/TMPVolumeCreator.lock"
if [[ -f "$LOCKFILE" ]]; then
return 1
fi
touch "$LOCKFILE"
RAMDISK=$(hdiutil attach -nomount ram://2097152 2>/dev/null | xargs)
echo "Creating RAM disk at $RAMDISK..."
if [[ ! -b "$RAMDISK" ]]; then
echo "Error: Failed to create RAM disk $RAMDISK."
diskutil eject "$RAMDISK" >/dev/null 2>&1 || true
rm -f "$LOCKFILE"
return 1
fi
diskutil erasevolume 'Case-sensitive APFS' 'TMP' "$RAMDISK" >/dev/null 2>&1 || {
echo "Error: Failed to format RAM disk $RAMDISK."
diskutil eject "$RAMDISK" >/dev/null 2>&1 || true
rm -f "$LOCKFILE"
return 1
}
rm -rf "$LOCKFILE"
echo "RAM disk mounted at /Volumes/TMP."
fi
}
But i don't think it is a good resolution, it should be fixed by Apple.