ConEmu icon indicating copy to clipboard operation
ConEmu copied to clipboard

Console is flashing on some applications under windows-build-in ssh

Open alexsigmund opened this issue 6 years ago • 38 comments

ConEmu build: 180526 preview x64 OS version: Windows 10.0.17134.112 x64

When I start a console (cmd or powershell) and connect to my ssh server via the ssh command (which comes with windows) and open mutt, the screen starts flashing. It seems that the screen switches between mutt and the normal console.

It appears that this comes from the fact that mutt runs in console fullscreen mode (like nano or vim) but produces output in the normal console. Other console fullscreen applications like nano are working normally.

On the normal cmd on Windows and on putty, mutt is working normally.

alexsigmund avatar Jul 02 '18 12:07 alexsigmund

  1. There is newer build
  2. I need screenshots or video

Maximus5 avatar Jul 02 '18 16:07 Maximus5

I had made a typo on the ConEmu build version.

ConEmu build: 180626 preview x64

Video: https://ibb.co/k0PKCJ

alexsigmund avatar Jul 04 '18 11:07 alexsigmund

I've already seen bugs in ssh.exe from system32. This implementation of ssh does not pass ANSI sequences to terminal (ConEmu) but calls WinApi functions. To be sure, you may run ConEmu64.exe -basic -log -run {cmd}, start ssh and mutt and upload log files

Maximus5 avatar Jul 04 '18 16:07 Maximus5

Hi, I am having a similar issue. First noticed several weeks ago on a colleagues notebook, but decided the issue looks too improbable and is likely device specific.

Now (i suspect once my windows device caught up with updates), I am suffering from the same issue. First noticed it on "mc" - midnight commander, but based on alexsigmunds comments also tried mutt - same issue, exactly as the video above.

You can find my logs on sedspace

I should note, that I have noticed this issue on CMDer, that is currently running of the "stable" version of ConEmu. As this is a somewhat dated version, not sure if it's still relevant.

I have therefore tested also the "preview" version of ConEmu, same results (sendspace)

CargoCoder avatar Jul 09 '18 15:07 CargoCoder

  • https://conemu.github.io/en/VersionComparison.html#release-stages
  • https://conemu.github.io/en/OldBuild.html

Maximus5 avatar Jul 09 '18 16:07 Maximus5

My logs: https://www.sendspace.com/file/dbpyyx

alexsigmund avatar Jul 09 '18 17:07 alexsigmund

@CargoCoder Windows version? ssh version?

Maximus5 avatar Jul 09 '18 19:07 Maximus5

Dear Maximus5, thank you for your prompt response - and please forgive my delayed one. Based on your response, I am only testing the "preview" version (will be happy to test the alfa version if required).

Hopefully this (sendspace) is the log you were looking for. I am connecting from Windows 10 ( Ver. 1803, build 17134.112 - not sure it means anything). The OpenSSH I was connecting to while logging was OpenSSH_6.4p1-hpn14v2, OpenSSL 1.0.2h. The server is running Gentoo.

Since that IS somewhat dated version of OpenSSH, I have also tested against OpenSSH_7.5p1-hpn14v12, OpenSSL 1.0.2n , ( sendspace ). Again running Gentoo.

CargoCoder avatar Jul 10 '18 14:07 CargoCoder

I also encounter similar issue when using vifm (you need to enter :help mode to reproduce). Can confirm the behavior of mc and Vim mentioned above. I think there have to be something in common between mutt, mc and vifm.

Also this is not happening to ssh.exe in Git Bash, so probably we should work with OpenSSH team (or PowerShell team) to figure out a fix.

Cause of this issue may be the same as #1649.

I've already seen bugs in ssh.exe from system32. This implementation of ssh does not pass ANSI sequences to terminal (ConEmu) but calls WinApi functions.

What does that mean? Do they simply paint the color themselves? Isn't that the job of terminal?

FranklinYu avatar Jul 19 '18 19:07 FranklinYu

I also confirm this behavior for mc under ssh. Really bad flickering, you cannot use it anymore.

klodoma avatar Aug 10 '18 07:08 klodoma

Hello Guys, first apologize for my english. I had the same flashing problem with mc in ssh in win10 since april win10 update. After some research and to do short: ssh in now include in win10 and is used by default in conemu (Cmder) and this is cause the flashing. If you go cd to C:\Program Files\cmder\vendor\git-for-windows\usr\bin and then enter .\ssh , connect to your favorite serveur and run mc : no more pb. I hope this help. I just found it this morning in holidays to Santorini Bye

EDIT: The best way for me is to remove openssh in optional applications of win10

EDIT 2: Ok not wake up. I read again this post and I realize my environnement is not the same as describe. But I think this problem come from windows ssh version not from conemu.

Kicknride avatar Aug 11 '18 05:08 Kicknride

Dear Kicknride, damned - that is it! I can confirm that removing the windows native ssh client (that I had no idea was there) and restarting the computer fixed the issue.

image

CargoCoder avatar Aug 16 '18 07:08 CargoCoder

Uninstalling the Windows OpenSSH Client immediately solved the problem for me. I didn't even have to restart. 👍

I wasn't aware that this was present, as I specifically installed the latest OpenSSH with the scoop package manager.

sdellenb avatar Sep 03 '18 05:09 sdellenb

@sdellenb @CargoCoder Note that this issue explicitly specified “windows-build-in ssh” in title. The SSH in MSYS2 is known not to have this issue. (It has other issues though, but that’s beyond the scope of this issue report.)

And Git-on-Windows also brings the MSYS2, so anyone using their OpenSSH is also not affected by this issue (after they uninstall the built-in one, of course).

FranklinYu avatar Sep 03 '18 05:09 FranklinYu

I also hit this issue today and only some googling brought me to this.

I would suggest that Cmder is tweaked to use own ssh even if system one is installed, or at least produce a warning.

Too bad that Cmder does not have a proper installer that would be offering this option or just removal of system openSSH

ghost avatar Sep 06 '18 10:09 ghost

@onkami Suggestion of Cmder should go to https://github.com/cmderdev/cmder.

FranklinYu avatar Sep 06 '18 13:09 FranklinYu

@franklinyu I opened it there, but don't you think it may be a ConEmu issue, that Cmder uses as is? :)

ghost avatar Sep 06 '18 14:09 ghost

@onkami I have never used Cmder, but "being tweaked to use own SSH" doesn't make sense in ConEmu, because there is no "own SSH". ConEmu doesn't come with any SSH at all. If Cmder includes SSH then they are the ones to bind SSH to whatever terminal they use. It's like blaming Hunts when McDonald's put the ketchup in Coke.

Removing system SSH would be more absurd for ConEmu (though it may make sense for Cmder).

In contrast, "making ConEmu work with OpenSSH" (or even "making OpenSSH-Win32 work with ConEmu") is what this issue targets.

FranklinYu avatar Sep 06 '18 15:09 FranklinYu

Thanks for the clarification :)

ghost avatar Sep 07 '18 07:09 ghost

Same isssue. @Maximus5 don't you use ssh client in ConEmu? :)

koutsenko avatar Sep 27 '18 19:09 koutsenko

Open-ssh is not a good choice. I use ssh from git-for-windows.

Maximus5 avatar Sep 27 '18 19:09 Maximus5

I tried it:

-bash-4.1$ mc 0 [main] ssh 12400 C:\Program Files\Git\usr\bin\ssh.exe: *** fatal error - cmalloc would have returned NULL Stack trace: Frame Function Args 00180000000 0018005E0DE (00180230639, 00180230C39, 000FFFFA0E0, 000FFFF9270)

koutsenko avatar Sep 27 '18 19:09 koutsenko

Same for me when using mc (Midnight commander) inside vagrant box. My ConEmu version is 180626 preview x64.

Also noticed that

  • When started with BufferHeight On: the icon BufferHeight mode keeps switching itself On and Off while screen blinks.
  • When started with BufferHeight Off: screen blinks much faster

piotr-cz avatar Nov 27 '18 10:11 piotr-cz

my cmder also flashing on 2 condition

  1. when opening nano and drag the size of console,
  2. when running ssh to remote ubuntu. and start a program running on 2 detached screen, it flashing detached screen

I wonder is that cmder is conflict with cygwin open-ssh?

and how to solve this? thank you...

cmder_flashing.zip

ahanjaya avatar Feb 06 '19 12:02 ahanjaya

Adding c:\tools\Cmder\vendor\git-for-windows\usr\bin; to cmder Settings->Startup->Environment did the trick for me.

cmder-ssh-flashing-fix

ihorzenich avatar Feb 15 '19 11:02 ihorzenich

As I'm not using cmder but git for windows, setting this environment variables worked for me:

set PATH=%ConEmuBaseDir%\Scripts;%PATH%
set PATH=%ProgramFiles%\Git\usr\bin;%PATH%

piotr-cz avatar Feb 15 '19 12:02 piotr-cz

For anyone who encountered this issue and does not want to change windows openss-client I can advice to launch mc in a new tmux window. It works perfectly with conemu.

kumamonishe avatar Oct 06 '19 09:10 kumamonishe

Got the same issue on Windows 10 with vagrant ssh and mc inside.

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"
  config.vm.provider "virtualbox" do |vb|
     vb.memory = "1024"
  end
  config.vm.provision "shell", inline: <<-SHELL
     apt update && apt install -y mc
  SHELL
end

Commands to reproduce it in ConEmu console:

vagrant up && vagrant ssh
mc

tmux helps, but it disables the scrollbar.

evgenybf avatar Oct 23 '19 11:10 evgenybf

The trick is to put a non-windows ssh client (e.g. coming from MSYS2 or Git-for-Windows) into PATH environment variable of Windows OS. This way there is no need to uninstall built-in Windows ssh client.

Then Vagrant and other programs will use it and this bug (blinking) will not happen.

But the question is: which downsides are if using non-builtin Windows ssh client?

What I noticed so far is colors of PS1 are gone (with Windows builtin ssh they are worked fine). Maybe there are some other downsides like non-working ssh-agent or something like this?

xak2000 avatar Nov 24 '19 17:11 xak2000

@xak2000 Author is using Git Bash himself so I imagine that Git Bash would have less issues, and issues about Git Bash will be fixed more actively. For example, I have created two issues here, #1726 was closed while #1649 is still open.

FranklinYu avatar Nov 26 '19 06:11 FranklinYu