Error in port monitor in Arduino IDE 2.1.1

Thank you so much for that simple solution which works perfectly. I've been bashing my head over it for days. The weird thing is the monitor v 0.14 worked perfectly well with my Teensy 4.1 but I got the 'Port monitor error: EOF' when connected to an STM32 based 'Black Pill' board, which threw me off the scent a little.