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

Don't clear screen on mosh connection #123

Closed
josharian opened this issue Apr 10, 2012 · 5 comments
Closed

Don't clear screen on mosh connection #123

josharian opened this issue Apr 10, 2012 · 5 comments

Comments

@josharian
Copy link

Feature request: It'd be nice if the mosh client didn't clear the screen when establishing a connection, or if there was at least an option to disable that behavior. Frequently there's useful context up there I want to have available once I've connected.

Thanks for an awesome tool. :)

@keithw
Copy link
Member

keithw commented Apr 10, 2012

Unfortunately we need to know what's in every cell of the screen for mosh to work (just like GNU screen and tmux), so we do have to initialize the terminal to a known state on startup. (And there's no way to sniff out what's already there...)

Sorry!

@keithw keithw closed this as completed Apr 10, 2012
@josharian
Copy link
Author

Bummer.

I wonder if there's a workaround. Would it work to just echo $LINES newlines? The screen would then be clear (and thus in a known state), but the scrollback would be preserved...

@keithw
Copy link
Member

keithw commented Apr 10, 2012

Possibly -- you might try that yourself now with a --client= argument to
mosh. (Can be whatever you want followed by "; mosh-client".) That might
meet your needs.

Cheers,
Keith
On Apr 10, 2012 4:33 PM, "Josh Bleecher Snyder" <
reply@reply.github.com>
wrote:

Bummer.

I wonder if there's a workaround. Would it work to just echo $LINES
newlines? The screen would then be clear (and thus in a known state), but
the scrollback would be preserved...


Reply to this email directly or view it on GitHub:
#123 (comment)

@josharian
Copy link
Author

Good call! Works beautifully. For future spelunkers, here's a little script that works:

#!/bin/bash
for f in `seq 1 $LINES`; do echo; done
exec mosh-client $@

@cgull
Copy link
Member

cgull commented Jun 26, 2015

Not all shells set LINES automatically. Better is this:

#!/bin/sh
for f in $(seq 1 $(tput li)); do echo; done
exec mosh-client $@

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

3 participants