Closed n9iels closed 1 month ago
@lewis-yeung something in your changes that influence this?
@n9iels What is the last working version for you? Is it v23.7.2?
@n9iels What is the last working version for you? Is it v23.7.2?
Yes I believe so, but not 100% sure... let me try to figure out how to revert to a previous version tomorrow to be sure.
Bit more context, this bug appears in situations where you spwan a terminal from either executing a script or running a test from VSCode.
@JanDeDobbeleer Can you reproduce this? I don't have a macOS environment to test it out.
@lewis-yeung didn't check yet, still on low holiday mode
Yes. I'm having the same issue. I run Ubuntu and start my tmux sessions from a script, but the commands are being outputed as text before the prompt appears and none of them are being executed. I happened right after updating oh-my-posh.
similar issues with tmux right here on macOS (mentioned in this issue )
and same on linux
Another confirmation that this is happening on MacOS. Commands are echoed rather than executed.
/Users/ehawman/test.command; exit
Last login: Wed Sep 11 15:10:57 on ttys003
═ zsh ehawman@myhostname Wed | 15:11:08 0ms
╚ ⠀
With the omp eval line in my .zshrc
commented out:
/Users/ehawman/test.command; exit
Last login: Wed Sep 11 15:12:07 on ttys002
ehawman@myhostname ~ % /Users/ehawman/test.command; exit
This test has been a success
Press enter to continue
I also tested changing my default shell to bash
and confirmed the same behavior. I tested using both Iterm2 and the default Terminal application and confirmed the same behavior.
So, this isn't a bug per se but an incompatibility issue. It's the upgrade notice that breaks this. It seem to be one or the other, when we execute the logic to check for an upgrade, anything which is entered isn't executed. The following settings re-enables that behaviour, with the downside of not seeing upgrade notifications:
"disable_notice": true,
"auto_upgrade": false
@JanDeDobbeleer I can confirm your additional settings solves my issues
I work IT and oversee a Mac that other employees use intermittently. A month ago the machine works fine. I come in to do some tweaks and suddenly the scripts aren't working. I spent a long time looking under the wrong rugs: Testing different terminal emulators, different shells, different .command
files, seeing if an update to Sonoma changed behavior, maybe a different shebang, etc. I finally discovered it was OMP by commenting out my .zshrc
and uncommenting line by line. Could I have discovered the cause more quickly? Absolutely. Did it take me a while? Also yes.
I fear that this silent, esoteric failure will entrap someone else in the future.
Is there anything we can do to give future me's a helping hand in identifying/preventing it?
Obviously the most optimal thing would be to figure out how to keep the upgrade feature and execute these externally launched commands, but barring that what if:
Personally, I feel that OMP should prioritize seamless terminal behavior over augmenting the upgrade process, esp since that overlaps with package managers. It's a great feature but not at the cost of silently breaking workflows.
I'm not mad about it and I don't want to come off as a whiner or ungrateful for this awesome tool. I just want to save someone else the headache going forward.
Upgrade defaults to disabled and is enabled by setting options.
@ehawman-rosenberg I feel like this is the only correct option, I have a branch open for breaking changes, will add that one there as well.
So, this isn't a bug per se but an incompatibility issue. It's the upgrade notice that breaks this. It seem to be one or the other, when we execute the logic to check for an upgrade, anything which is entered isn't executed. The following settings re-enables that behaviour, with the downside of not seeing upgrade notifications:
"disable_notice": true, "auto_upgrade": false
I can confirm this resolves this issue 🥳 I personally have no problems with disabling the upgrade and notice. Thanks for the little investigation!
Code of Conduct
What happened?
Sicne the last upgrade command are not getting executing while the terminal is still loading. The issue is similair to this older issue: https://github.com/JanDeDobbeleer/oh-my-posh/issues/4072. I used to have
disable_cursor_positioning = true
in my config and this worked. After the upgradeenable_cursor_positioning
should be false to my understanding.Theme
custom
What OS are you seeing the problem on?
macOS
Which shell are you using?
zsh
Log output