Hi Nige,
I appreciate the detective work you've done, and I should have looked at the XML of my macro itself as you did. An excellent approach.
However, you've made a small wrong assumption here. I am using BASH, not zsh. More importantly, I'm using the default BASH shell that comes with the Apple System OS (version 3.2x) not the BASH that Homebrew installs (BASH 5.2x). Bash 5.2 uses "bracketed text" (like zsh) as a default. Bash 3.2 doesn't have bracketed text.
BTW, I tried BASH 5.2 with and without bracketed text and it had its own issues with what I do with Terminal Paste. So I uninstalled it, confirmed with several tests and I'm on the default Apple bash 3.2.
$ sed -i '' 's/enable-bracketed-paste off/enable-bracketed-paste on/' ~/.inputrc
To be certain, I have modified my .bash_profile to have bracketed text set to off, even though Bash 3.2 has it as its only option and will ignore this setting.
Maybe I'm not understanding this properly but the fact that Simple Text shows the raw xml to be same in both cases, yet KM displays it (and executes it) differently on each system again suggests to me that it's not system-related but perhaps KM related (?)
I use bash because many of my routines use a meteorological utility called wgrib2 that runs on bash. (It might run on zsh, but wgrib2 is tricky executable to compile and any online documentation, of which there has been very little for running on MacOS, always refers to bash. I never look to make my life harder than it needs to be.)
As for why I was running these things as a Terminal paste, rather than an external script, I've put these macro routines together over many years and
- it always worked in the past on past systems and past versions of KM
- I like to see where things go wrong and having it display in Terminal in real-time is very helpful.
Finally, "Type into Terminal" is slow and sometimes it starts executing before it's done typing.
That said I am moving larger bash text scripts and python scripts that I had previously directly pasted in Terminal and converting them to external scripts.
But for small Terminal commands, paste in Terminal works if I add the carriage return in GG (but if I retrograde to Sequoia) there will be 2 carriage returns in the paste. I'm wondering if Peter Lewis will chime in on what he's read here.