martanne / abduco

abduco provides session management i.e. it allows programs to be run independently from its controlling terminal. That is programs can be detached - run in the background - and then later reattached. Together with dvtm it provides a simpler and cleaner alternative to tmux or screen.
ISC License
764 stars 52 forks source link

Output isn't redrawn when attaching to a session #30

Open cherryman opened 6 years ago

cherryman commented 6 years ago

This can be easily seen in a pager.

abduco -c man man man

Connecting the first time often works (but not always).

abduco -a man

However, upon re-attaching, the terminal is usually emtpy, and requires scrolling to actually redraw.

This isn't perfectly consistent. Sometimes, after restarting the terminal, it redraws the first time but not the second.

Javyre commented 6 years ago

maybe triggering a resize event on reconnection can solve this issue?

phillid commented 6 years ago

My guess would be that the program being wrapped is trying to be too smart with SIGWINCH (which abduco sends to tell a wrapped program to redraw) that it receives, and is opting not to redraw because the dimensions of the terminal before and after the SIGWINCH are the same. If this is the case, the problem being intermittent like you describe is probably a result of the terminal sometimes having different dimensions on attachment than at the last redraw.

It is probably best to contact the maintainers of the software in question.

SeerLite commented 2 years ago

@phillid Makes sense! However, I don't think the maintainers of the software are at fault. There is no reason one should expect SIGWINCH to signal anything other than a window resize. If the program covers all possible use cases for when a window is resized then it's working as intended. abduco is relying on a coincidence.

My current editor (Kakoune) doesn't redraw everything on resize. This leaves it almost unusable when attaching with no way to fix it without restarting it.

I think abduco should remember the state of the terminal.