Maximus5 / cygwin-connector

https://conemu.github.io/ terminal connector for cygwin/msys
https://conemu.github.io/en/CygwinMsysConnector.html
Other
82 stars 5 forks source link

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

Open salmonax opened 8 years ago

salmonax commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

salmonax commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

salmonax commented 8 years ago

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 commented 8 years ago

Nice, waiting for them.

From my previous experience, there was problems with

salmonax commented 8 years ago

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. :-)