terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Terminal does not fully restore on restart if it had been minimized in the dock

Open aminya opened this issue 5 years ago • 22 comments

Terminal does not fully restore on restart if it had been minimized in the dock.

See https://github.com/atom-ide-community/terminal/issues/30#issuecomment-711109168

aminya avatar Oct 08 '20 21:10 aminya

Can you give more information about how often this happens? what exactly doesn't restore? reproducible conditions?

UziTech avatar Oct 09 '20 13:10 UziTech

When I start an Atom session, I expect the terminal to start again if it was open. Similar to how Atom recovers the open text editors.

aminya avatar Oct 12 '20 08:10 aminya

Seems to work fine for me. Do you have the Allow relaunching terminals on startup setting checked?

UziTech avatar Oct 12 '20 15:10 UziTech

Yes, I do have it checked. This is random though. Sometimes it works! I will try to get some reproduction steps.

aminya avatar Oct 12 '20 19:10 aminya

This is what I mean. I need to close this and start a new one: image

aminya avatar Oct 17 '20 22:10 aminya

are there any errors in the console? Can you inspect the element and see why it is hidden (display: none, height: 0, etc.)?

UziTech avatar Oct 17 '20 23:10 UziTech

It might be something that could be fixed by https://github.com/xtermjs/xterm.js/pull/3089

UziTech avatar Oct 17 '20 23:10 UziTech

There are no errors. It just does not show anything. It is like an empty pane (like in #5)

There is no element to choose:

image

aminya avatar Oct 18 '20 01:10 aminya

looks like your IntersectionObserver never gets called. Try setting some log statements to log out entries in https://github.com/atom-ide-community/terminal/blob/master/src/element.ts#L64 so next time it happens we can get more information.

I wonder if this is something with the atom-community version of atom?

UziTech avatar Oct 18 '20 02:10 UziTech

Sure. I can add the logs. I am using the latest nightly.

aminya avatar Oct 18 '20 02:10 aminya

I had a terminal open in the bottom dock, I minimized it. Closed Atom, and opened it again. The pane was empty:

image

Not minimizing the terminal before closing fixes the issue: image

aminya avatar Oct 18 '20 02:10 aminya

How is entries.length equal to 0? That should not even be possible. Basically that says there was an intersection observed but no intersections.

That doesn't happen for me.

UziTech avatar Oct 18 '20 03:10 UziTech

How can I get more information about entries? This seems like an xterm thing. Let me see if I can debug into xterm

aminya avatar Oct 18 '20 03:10 aminya

This doesn't have anything to do with xterm. This looks like an issue with your version of electron. or more specifically the version of chromium bundled with electron.

UziTech avatar Oct 18 '20 03:10 UziTech

This is what happens when I try to debug inside the IntersectionObserver callback:

image

If I click keep it open: image

aminya avatar Oct 18 '20 03:10 aminya

IntersectionObserver is part of the browser (chromium). That is an issue with the browser, nothing we can change.

The only way we could fix it is use some other way to check for visibility using setTimeout and getBoundingClientRect

UziTech avatar Oct 18 '20 04:10 UziTech

The issue is not still solved. You mentioned you can hack something using setTimeout. Can you look into that? @UziTech

aminya avatar Apr 29 '21 04:04 aminya

I'll take a look at it tomorrow. It will be hard for me to debug though because it doesn't happen to me. I still don't understand how it happens to you. I wonder if you have some package that polyfills IntersectionObserver incorrectly.

UziTech avatar Apr 29 '21 05:04 UziTech

The biggest problem with polling with setTimeout is it is going to be a performance nightmare.

UziTech avatar Apr 29 '21 05:04 UziTech

The basic idea is we will have to poll with setTimeout until the user opens the dock, which could be never.

UziTech avatar Apr 29 '21 05:04 UziTech

If that hurts the performance we should do something else.

aminya avatar Apr 29 '21 22:04 aminya

I don't think there is anything else to do. I think the best approach is for you to figure out why it doesn't work for you.

UziTech avatar Apr 30 '21 00:04 UziTech