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

Dialog windows quit Unexpectedly in 2.4.1 #351

Closed
jeden-92 opened this issue Feb 19, 2024 · 5 comments
Closed

Dialog windows quit Unexpectedly in 2.4.1 #351

jeden-92 opened this issue Feb 19, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jeden-92
Copy link

Describe the bug
Since updating to 2.4.1 my script which launches a dialog and then updates it with the update dialog command, will show the first dialog then the script progresses and the dialog will quit but the script still completes in the background. gives this error in the cmd output /usr/local/bin/dialog: line 18: 2296 Trace/BPT trap: 5 launchctl asuser "$uid" sudo -u "$currentUser" "$@"

To Reproduce
Steps to reproduce the behavior:
my script is a clone of this script https://github.com/PezzaD84/Assemble so running the unedited version will reproduce the issue, if run with an older version of dialog the script performs as expected. this occurs on ventura and sonoma.

Expected behavior
the dialog should not quit

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • macOS version 13.6.4 and 14.3.1
  • swiftDialog version 2.4.1

Additional context
Add any other context about the problem here.

@BigMacAdmin
Copy link
Collaborator

I dug through this and can confirm this bug.

Easy to reproduce:

#!/bin/bash

/usr/local/bin/dialog -t "test" -m "message" & 

sleep 1

echo 'height: 200' >> /var/tmp/dialog.log

Sending a "height" adjustment command to any running dialog causes a crash. Confirmed this is an issue in 2.4.1, 2.4.0 does not display this behavior.

@jeden-92 to side step this in the mean time, you can adjust that script to have the initial dialog set to the desired height and comment out the line with echo "height: 600" >> $commandLog

@jeden-92
Copy link
Author

@BigMacAdmin the height adjustment was the one thing i didn't think to check, this is good to know i will apply this fix in the interim.

@bartreardon bartreardon self-assigned this Feb 19, 2024
@bartreardon bartreardon added the bug Something isn't working label Feb 19, 2024
@bartreardon
Copy link
Collaborator

cheers for that - I'll have a look and see what's causing the crash

@bartreardon
Copy link
Collaborator

solved it - came about due to a change where I moved the window management code out of the SwiftUI app lifecycle and into an AppDelegate. In that context, the main observable object that contains the app state is not available and the mainWindow object doesn't get set.

Probably needs some more cleanup as I think that variable now goes unused but works in limited testing.

@Bearzooka
Copy link

Probably it's obvious (being part of the mainWindow code) but worth mentioning that this happens as well if the width of the window is changed.

fraserhess pushed a commit to fraserhess/swiftDialog that referenced this issue May 31, 2024
…ich may be nil, provide a default if the unrwap fails

Fixes swiftDialog#351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants