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 issue #1427 | UtilityAreaTerminal model changed to ObservableObject #1496

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

kmohsin11
Copy link
Contributor

Description

  1. When the user presses the "-" button to close the selected terminal tab, the app crashes. This was not happening everytime. The crash is reproducible if the app is idle for a while and then the tab was removed.
  2. If a terminal tab is in editable state(rename state) and then remove/minus button is tapped the app crashes.

Related Issues

closes #1427

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2023-11-29.at.10.30.48.AM.mov

Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes mentioned on discord:

  • The root problem is caused by passing terminal as a binding on line 195 of UtilityAreaTerminalView.swift
  • I'd like to keep UtilityAreaTerminal a struct, as it should be treated with value semantics and copied rather than shared and mutated like a class in this context.
  • The change to id being a constant is smart.

Once these couple things are changed I'll happily merge!

Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some discussion @kmohsin11 and we realized trying to juggle around structs to keep semantics ended up being more complicated than it was worth.

Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@austincondiff austincondiff merged commit 8131ca8 into CodeEditApp:main Dec 1, 2023
2 checks passed
@austincondiff
Copy link
Collaborator

@allcontributors add @kmohsin11 for bug

Copy link
Contributor

@austincondiff

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

@thecoolwinter thecoolwinter added the bug Something isn't working label Dec 23, 2023
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

Successfully merging this pull request may close these issues.

🐞 Removing terminal tab crashes app
3 participants