Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6237; omp.lua script errors if launching oh-my-posh fails #6238

Merged

Conversation

chrisant996
Copy link
Contributor

fix: The omp.lua script was missing some error handling, which caused Lua to abort the script and print errors to the terminal.

  • Error handling is needed when calling io.popen().
  • Error handling is needed when calling io.popenyield().
  • Error handling is needed when calling os_clock_millis().
  • When the omp.lua prompt filter failed to generate a prompt string, then there was no prompt at all, which was very confusing. Now upon failure it writes a log entry into the clink.log file and generates a simple basic default prompt string plus a note that it failed.

resolves #6237

@JanDeDobbeleer JanDeDobbeleer changed the base branch from main to next March 7, 2025 08:07
The omp.lua script was missing some error handling, which caused Lua to
abort the script and print errors to the terminal.

- error handling is needed when calling `io.popen()`.
- error handling is needed when calling `io.popenyield()`.
- error handling is needed when calling `os_clock_millis()`.
- when the omp.lua prompt filter failed to generate a prompt string,
  then there was no prompt at all, which was very confusing.  Now upon
  failure it writes a log entry into the clink.log file and generates a
  simple basic default prompt string plus a note that it failed.

resolves JanDeDobbeleer#6237
@JanDeDobbeleer JanDeDobbeleer merged commit a55dd47 into JanDeDobbeleer:next Mar 7, 2025
7 checks passed
@JanDeDobbeleer
Copy link
Owner

@all-contributors please add @chrisant996 for code

This is pure magic 🪄! @holopin-bot @chrisant996 wizard

Copy link

holopin-bot bot commented Mar 7, 2025

Congratulations @chrisant996, the maintainer of this repository has issued you a badge! Here it is: https://holopin.io/claim/cm7yij68g85380cjutjitsnjt

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

Copy link
Contributor

@JanDeDobbeleer

I've put up a pull request to add @chrisant996! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

omp.lua script errors if launching oh-my-posh fails
2 participants