question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The application freezes while resizing the terminal on MacOS

See original GitHub issue

Describe the bug The whole app freeze If I resize the terminal while Application fetching the current time from internet.

To Reproduce https://www.toptal.com/developers/hastebin/iruwokoxuw.csharp

Desktop:

  • MacOS

Additional context I don’t know if it’s a bug or I’m doing something wrong. But the same issue you will get in Threading scenario from UICatalog if you run few tasks and start playing with terminal size by mouse.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:20

github_iconTop GitHub Comments

1reaction
kacperpikaczcommented, May 24, 2023

@tig Sorry for the confusion. It’s fixed now in develop.

1reaction
kacperpikaczcommented, May 24, 2023

You need to update the TextField like this. Here you don’t need to call Application.MainLoop.Invoke because the AddTimeout already handles that. You also don’t need to call SetNeedsDisplay because the Text property already do that.

		static Func<MainLoop, bool> fetchTime = (loop) => {
			UpdateTimeAsync ();
			MainField.Text = Clock.unixtime.ToString ();
			//MainField.SetNeedsDisplay ();

			return true;
		};

I appreciate your recent fix @BDisp but as you can see in the code I’m not trying to update the TextField in any way. But application still will freeze because of UpdateTimeAsync()

I can confirm that your fix is working with threading scenario from UICatalog but not fixes issue what you can see below.

When you replace TextField with Label, there is no issue with resizing & UpdateTimeAsync method fire every 500 ms.

Code https://hastebin.com/share/ucehihumoy.csharp

My mistake, I added the reference to the wrong project. I apologize for the misunderstanding. Recent commit fixes the problem.

https://github.com/gui-cs/Terminal.Gui/assets/76921244/83709188-cfbd-4cad-8454-f23df89be2ce

Read more comments on GitHub >

github_iconTop Results From Across the Web

macOS Big Sur Terminal hangs and no prompt appear
After this, every time I open any terminal prompt, with the default app or iTerm, zsh, bash, etc., does not appear, and the...
Read more >
Anybody get terrible freezing / lag when using Magnet ...
It eventually completes the resizing, but only after freezing my window. I've tried everything—restarting Magnet, restarting my computer, etc., ...
Read more >
[vim/vim] Crash when resizing terminal with popup visible ...
Describe the bug. Vim crashes when resizing the terminal with a popup visible. To Reproduce. Detailed steps to reproduce the behavior:.
Read more >
macos - App freezes when resizing window?
For some reason when I try to resize the window, it freezes and I'm unable to resize the window and open the menu-bar...
Read more >
Vanilla 1.8.9 crashes when resizing window
I can still launch and run vanilla 1.8.9 just fine, but as soon as I drag the corner of the window to resize...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found