I have again marked the post from @MrLavender as the solution, as it satisfies the criteria of the original issue, without delving into tangential and experimental aspects.
This may be a judgement call, of sorts, but I trust all involved will likely agree. Naturally, the OP can change this (yet again) if they believe otherwise, and would like to start a T-Shirt collection.
Sure, and I’ve broken plenty of things in the past by doing that which is why I err much more on the side of caution these days. Been there, done that, have the t-shirt
But in the spirit of breaking things…
All that function is doing is sending an OSC 7 escape sequence to tell a terminal what the current working directory is. Many terminals, including Konsole, don’t actually need that because they can detect the cwd themselves. So a very easy way to fix your particular use case is to either remove the hook that calls the function (as described in the original Oh My Zsh issue) or just set the function to {}.