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

Entering SSH+Screen, exiting SSH, causes terminal output issues as of 0.7.3 #9

Open
salmonax opened this issue Feb 17, 2016 · 9 comments

Comments

@salmonax
Copy link

Using conemu-cyg-64, cygwin 2.2.1, reproduced with both ConEmu 151207 and 160211, connector 0.7.3 and 0.7.4.. Doesn't cause the issue without Screen, and 7.2 works fine.

Various issues occur:

  1. intermittently, "cat AnsiColors256.ans" will draw at the top of the terminal, spilling into a single line and disappearing. This co-occurs with the ssh exit message fixing itself to the bottom of the terminal, rather than appearing above the local prompt.
  2. Filling the terminal with text on the SSH+Screen side and exiting will fail to move drawing to bottom and cause overdraw, which didn't occur in 0.7.2
@salmonax
Copy link
Author

Woops. It occurs with 0.7.2 and 0.7.1 as well, but I can't figure out why, except that process event messages come into the terminal out of order whenever it happens.

@salmonax
Copy link
Author

Sleuthed this a little further: the issue starts happening at 0.4.7, which is when the cygwin connector started setting $TERM to 'xterm-256color' instead of 'cygwin.' Changing $TERM manually with 0.4.7 reproduces the problem. Changing $TERM to cygwin in latest versions straightens out the line-jumbling (as does switching to cons25, vt100, etc.) but breaks colors in ssh.

@Maximus5
Copy link
Owner

So, why do you think that screen bugs are related to connector or ConEmu?

@salmonax
Copy link
Author

Simple: because it doesn't happen in native terminals, it doesn't happen in ConEmu without the connector, and it doesn't happen in MinTTY. The meltdown is also fairly egregious; it doesn't happen in Screen, but after Screen is exited, causing all further terminal output to wind up on a single line at the top of the terminal. I would bet that it can be reproduced in another way, but that this just happens to be the one I found. There is something about how the connector works that isn't correctly handling what I suspect to be Bash job control notifications.

Ultimately, if the intention is for POSIX support to be stable, it makes sense to want to know the cases in which normal operation (and pretty unobscure operation, at that) causes everything to break, rather than saying "oh, if Screen broke it, that must be Screen's problem," no?

@Maximus5
Copy link
Owner

From what you have described, the problem appears if TERM is set to xterm-256color, Isn't it? Also, you have not checked (seems like) the behavior of screen, when TERM is set to xterm-256color in mintty.
So, the descsription of the problem is not complete at least.

@Maximus5
Copy link
Owner

Anyway, I need exact steps to reproduce and screenshots highlighting the problem.

@salmonax
Copy link
Author

Good point. I just made sure to try it in MinTTY, and it doesn't do it when TERM=xterm-256color, either. With the connector in ConEmu, it happens for TERM=xterm and TERM=xterm-256color, but not for anything else I tried (vt100, cons25, screen, screen256-color, cygwin)

Hmm, ok. I can't deny that I'm doing something a little obscure (ie. running screen over ssh to a remote linux terminal, then detaching), but the terminal that goes screwy is a bare cygwin prompt, and not wrapped either in SSH or screen, so I think it's sound. I'll spend some time tomorrow seeing what the bare minimum way to reproduce it is and post some shots.

@Maximus5
Copy link
Owner

Nice, waiting for them.

From my previous experience, there was problems with

  • wrong PATH. wrong binary (ssh.exe) was executed
  • wrong TERM. cygwin may behaves differently, if ssh.exe started directly from connector, or connector/bash login shell.
  • different profiles. cygwin applications has enormously large amount of dot files located in different places. In some cases these sets of files (paths to dot files) differs.
  • configuration on the server side. Well, it depends mostly on client's TERM but I have to mention.
  • Bug in ConEmu. That may happens too of course, but I need steps to reproduce. Also, the connector has --log switch which creates log file with raw output received from cygwin. It may help too.

@salmonax
Copy link
Author

Ok, I figured out what is causing it and how to induce it:

  1. Install screen for cygwin
  2. Add the line "termcapinfo xterm* ti@:te@", without quotes, to ~/.screenrc
  3. Run screen and exit. Notice that "[screen is terminating]" appears BELOW the prompt.
  4. Type "cat AnsiColors256.ans" You will get something like this

That termcapinfo line was something to enable mouse and shift-page up scrolling. It disables an alternate text buffer, according to the Screen FAQ. Since adjusting termcapinfo basically amounts to a hack, I could understand why this wouldn't seem like a critical problem. But hopefully it reveals an implementation quirk?

Sadly, I think I've given up on the connector for now. Glad to see that it exists, though. :-)

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

2 participants