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

Cannot scroll #35

Open
ju-w opened this issue Aug 1, 2018 · 12 comments
Open

Cannot scroll #35

ju-w opened this issue Aug 1, 2018 · 12 comments

Comments

@ju-w
Copy link

ju-w commented Aug 1, 2018

Hello. I connect to machines with SSH, but sometimes my connection drops.
I like to resume my work after reconnect without loosing my session.

I don't have need for multiplexing or anything fancy, I just want to resume where I left of.
I found dtach and abduco to be fitting for my purpose.

However there is one big showstopper in abduco:
Whenever I am connected to an abduco session, scrolling appears to be disabled.
In dtach, scrolling keeps working.

Is there a workaround or fix for this?

@ju-w
Copy link
Author

ju-w commented Aug 1, 2018

I understand the issue now. Abduco is using The Alternate Screen Buffer of X Term when switching to an abduco session.

However, I don't think this is a good choice. Consider this example

ls -la
# we are using normal buffer and can scroll
abduco -c some bash
# abduco is using alternate buffer, we cannot see previous outputs
ls -la
# output truncated & scrolling disabled
man man
# man is now also using the alternate buffer, effectively overriding abduco
q
# now we return to abduco session from man
# returning from man disables alternate buffer in abduco as well
# we can no longer see previous output from abduco ...
ls -la
# ... but scrolling now works

As demonstrated, every programm that is also using alternative buffer, like less, vi, man, ... breaks abduco's alternateive buffer and forces it to use normal mode, kind of defeating the purpose.

@mrksmrtn
Copy link

Are you using xterm or a different terminal? I tried your example with rxvt-unicode (urxvt) v9.22 and both scrolling and the alternate buffer worked correctly.

@malikbenkirane
Copy link

@mrksmrtn could you share your urxvt defaults ?

@mrksmrtn
Copy link

@malikbenkirane I forgot that I had some custom settings. Probably secondaryScroll is making a difference here.

URxvt*foreground: gray90
URxvt*background: black
URxvt*font: xft:Bitstream Vera Sans Mono-12,xft:Junicode
URxvt*scrollBar: false
URxvt*secondaryScroll: true
URxvt*loginShell: true
URxvt*utmpInhibit: true
URxvt*saveLines: 8192
URxvt*fading: 50
URxvt*visualBell: true
URxvt*cursorBlink: true

Sorry about the slow reply. I've been out of town.

@ghost
Copy link

ghost commented Dec 14, 2019

Scrolling up doesn't work in konsole either.

@ccrusius
Copy link

Adding to this - it also does not work in alacritty until I execute a command that requires scrolling, such as man abduco. It works after that for some reason.

@jamescassell
Copy link

jamescassell commented May 27, 2020

workaround is to printf '\033[?1049l' as first thing in the session, or when re-connecting, edit: or just tput rmcup

@martanne
Copy link
Owner

martanne commented Mar 6, 2021

The core issue is once again #32.

Conceptually it would indeed be cleaner if abduco would solely operate on the I/O level without issuing any terminal escape sequences. Note however, that simply removing the code to enter/leave the alternate screen buffer merely trades one problem for another. If you are running an interactive application in alternate screen mode and then detach it would have to be restored upon reattaching. This really needs some coordination with another utility like dvtm.

@shadowcat-mst
Copy link

I generally have to do a ^L to get a full screen app (mutt) to repaint after I reattach, so at least an -option- to leave me in the same state I'd get via reattach then tput rmcup might be nice ... though it's really not a major obstacle to me, just it surprised me moving from dtach.

@shadowcat-mst
Copy link

Update: 'vi, :q' is now my spirit animal and annoys me so little I really don't care either way at this point.

goes back to enjoying using the code

@seankhl
Copy link

seankhl commented Aug 19, 2021

Haven't battle-tested it, but this function seems to pretty much instantly send the tput rmcup such that often I don't even see any kind of screen flash. This results in IMO better behavior than dtach, because there is no weird prompt-refreshing issues, and no empty commands or lines in my terminal.

function abduco-attach {
    (until abduco | grep -q "\*.*${1}"; do sleep 0.01; done && echo "tput rmcup" | abduco -a "${1}" &); abduco -a "${1}"
}

@guysherman
Copy link

Where do you put this function? And when do you trigger it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants