Hiding menu using commands also hides OSnap Toolbar

I have been using a keyboard shortcut to hshow/hide the menu bar of the window since Rhino 5:
“noecho -Options _Appearance _Visibility _Menu _Enter _Enter _Enter”

However, now it also toggles the visibility of the OSnap toolbar too. I couldn’t understand the reason behind this weird behavior and solve it myself.

Edit: Same happens when you toggle menubar using the Options window too.