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

Can't get this to work, msys-2.0.dll missing #6

Closed willemdh closed 8 years ago

willemdh commented 8 years ago

Hello,

As you suggested to try this cygwin-connector here: https://outsideit.net/generate-motd/ I decided to give it a try, read through this: https://conemu.github.io/en/CygwinMsysConnector.html

But when I try to use "set MSYSTEM=MINGW64 & conemu-msys2-64.exe"

I get a system error telling me msys-2.0.dll is missing. I tried from Cmder development version and from Conemu.

image

Grtz

Maximus5 commented 8 years ago

Docs page describes exact steps, with example for cygwin32: https://conemu.github.io/en/CygwinMsysConnector.html I can't know what posix installation you are trying and what have you done improperly. Of course, you must choose proper version for your cygwin/msys installation.

willemdh commented 8 years ago

I have a Cygwin64 installation in C:\cygwin64 As the installation was done some time ago, I redownloaded https://www.cygwin.com/setup-x86_64.exe and reinstalled 'exp'. Also updated Conemu to the latest version 151224[64] conemu-cyg-64.exe and conemu-msys2-64.exe are in the C:\cygwin64\bin folder. I keep getting this error with the installed Conemu.

So I tried downloading the portable version of Conemu, which was also on 151224[64] which did seem to work. But I'm having this annoying issue again where Conemu doesn't recognize my .ssh folder.

image

I had this issue in the past after which it was somehow solved by creating a script making the ssh connection. Any idea what might be the reason Conemu doesn't see my .ssh folder in my userprofile, which is 'C:\Users\Willem'.

%HOME% is set to my home directory in system variables.

Willem@F1REBASE C:\Users\Willem\Dropbox\Utilities\Cmder\scripts
> cd %HOME%
Willem@F1REBASE c:\Users\Willem

And trying ssh with -v:

> ssh -v willemdh@212.71.234.84                                                                         
OpenSSH_7.1p1, OpenSSL 1.0.2e 3 Dec 2015                                                                
debug1: Connecting to 212.71.234.84 [212.71.234.84] port 22.                                            
debug1: Connection established.                                                                         
Could not create directory '/home/Willem/.ssh'.                                                         
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_rsa type -1                                                  
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_rsa-cert type -1                                             
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_dsa type -1                                                  
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_dsa-cert type -1                                             
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_ecdsa type -1                                                
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_ecdsa-cert type -1                                           
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_ed25519 type -1                                              
debug1: key_load_public: No such file or directory                                                      
debug1: identity file /home/Willem/.ssh/id_ed25519-cert type -1                                         
debug1: Enabling compatibility mode for protocol 2.0                                                    
debug1: Local version string SSH-2.0-OpenSSH_7.1                                                        
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1                              
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000                                       
debug1: Authenticating to 212.71.234.84:22 as 'willemdh'                                                
debug1: SSH2_MSG_KEXINIT sent                                                                           
debug1: SSH2_MSG_KEXINIT received                                                                       
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none                               
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none                               
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY                                                               
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:P45my/ywmxv+fSgwKV/STiMGBHGX6pMJeiQ3oqO62hw         
The authenticity of host '212.71.234.84 (212.71.234.84)' can't be established.                          
ECDSA key fingerprint is SHA256:P45my/ywmxv+fSgwKV/STiMGBHGX6pMJeiQ3oqO62hw.                            
Are you sure you want to continue connecting (yes/no)?                                                  

Any suggestion is welcome.. :)

Maximus5 commented 8 years ago

Why do you try to run conemu-msys2-64.exe for cygwin64 installation?? You need only conemu-cyg-64.exe.

Maximus5 commented 8 years ago

As for your HOME it's not a ConEmu problem, it do nothing with files related to shells at all. You have to configure your cygwin installation properly, to point it into your Windows user home dir.

willemdh commented 8 years ago

@Maximus5 yes I know I have to set my home directory. Seems the issue was in /etc/passwd which seems to have priority on the Windows environment variable. I managed to solve the home folder issue by editing /etc/passwd

About the cygwin-connector, I'm feeling really stupid that I'm not getting it to work. I'm not getting the system error anymore when running from the portable Conemu version, but somehow it's no longer displaying 256 colors after ssh'ing into my server.

I tried many different task settings. I tried running conemu-cyg-64.exe manually from different types of shells. There is definitely a difference: When I run a CygWin Bash shell, then execute conemu-cyg-64.exe and then ssh, I get:

image

When I just start a CygWin Bash shell and ssh, I get:

image

Grtz

Maximus5 commented 8 years ago
  1. DO NOT start connector from bash!!! It's designed to be ROOT PROCESS.
  2. ssh-ing and remotes takes care of your TERM env.var. Connector sets it properly, if you do not prevent our override it.
willemdh commented 8 years ago

@Maximus5 Sorry man, I'm not sure what you mean exactly with "It's designed to be ROOT PROCESS.". I tried starting conemu-cyg-64.exe from Cmd Task and Powershell Task but i'm getting the same results as above. Also tried with new console dialog image

Tried with a task:

image

I'm probably missing something critical. Please enlighten me. :) "ssh-ing and remotes takes care of your TERM env.var" is also chinese for me. Sorry.

Maximus5 commented 8 years ago

If you run connector from new console dialog than it becomes root process. So this is OK. But you've said "I run a CygWin Bash shell, then execute conemu-cyg-64.exe and then ssh", and it's wrong approach.

Your task is perfectly correct, if connector is located in \cygwin64\bin folder and this folder was added to the %PATH%. So, you shall not have any problems with ssh. The only note about 256 colors is that due to current requirements they are working only with consoles without backscroll buffer, which may be turned off by -new_console:h0 in your task.

ssh client pass your local TERM variable to the ssh server. So this variable have strong effect on your screen. This var may be forcedly changed in your profile and this may cause differences in ssh behavior.

Maximus5 commented 8 years ago

Cygwin's ${HOME} and Windows profile directory: https://conemu.github.io/en/CygwinHome.html

willemdh commented 8 years ago

Thanks for the extra information. I get it working when I'm using as task:

conemu-cyg-64.exe -cur_console:h0

And manually type

ssh user@212.71.224.84

But it seems like I can't paste anything? The doc says:

h<height> - i.e., h0 - turn buffer off, h9999 - switch to 9999 lines

So I guess this is normal with h0 as switch, but any other switch I try seems to break 256 color support again. Any suggestions?

Maximus5 commented 8 years ago

You may run it at once

conemu-cyg-64.exe -cur_console:h0 ssh user@212.71.224.84

And what is the question about "paste"?

Also I've already described the requirements of h0 above.

willemdh commented 8 years ago

And what is the question about "paste"?

I regularly need to copy text to my console, this seems not possible. This is really a requirement for me to continue using it. Copying text from within the conemu-cyg-64.exe to the same conemu-cyg-64.exe console works but not from outside the console to within the conemu-cyg-64.exe console.

Maximus5 commented 8 years ago

Copy/Paste is working. connector do not have any differences from other console applications. So, copy/paste is working absolutely same way.

If not - you are doing something wrong. Describe your problem thoroughly.

willemdh commented 8 years ago

Ok, So I downloaded the portable alpha version of Conemu and put it in my Dropbox. Then I open ConEmu64.exe which opens the default shell

cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd"

Then I start a new task

conemu-cyg-64.exe -cur_console:h0 ssh user@212.71.234.84

So now I got an SSH session into my server with 256 color support thanks to the connector. So let's say I'm working on some code in Notepad++ where i copy some text with Control-C (or right click and select copy). Then I switch to the open tab in Conemu where i'm logged in my server. Then I right-click and expect the copied text to be pasted.

image

The text is not pasted and nothing is happening. When I'm trying this exact same text which is still in memory to another Conemu tab the text is pasted correctly.

image

When I ssh with a Cygwin Bash task into my server and try to paste this same piece of text it just works:

image

Let me know if I can provide you with any more info. One thing I notice weird is the % sign which shouldn't be there. You can see it in the first screenshot. This % is not visible in any other ssh session I'm doing to my server.

Maximus5 commented 8 years ago

Paste with Shift-Ins or Ctrl-V. RightClick is posted into awared console applications input buffer (ANSI sequences).

willemdh commented 8 years ago

Ok. That seems to work. I was so used to right click pasting. Let's close this up. Thanks for all the info and help. I'll update my blog post one of these days with this info. :)

willemdh commented 8 years ago

@Maximus5 Just one more question => any idea why the % sign is there? Is there some way to get rid of it? I'm only seeing it in the connector console.

EDIT: Ha I noticed something else. When the console is resized, the colors get scrambled..

image

image

Maximus5 commented 8 years ago

% AFAIK appears on badly formatted profile files. Different type of eol-s, etc. Ask on shell-related forums...

I know 256 color support is not perfect. This relates to ConEmu only, not a connector. It's in RoadMap.

rubyFeedback commented 3 years ago

For anyone finding this via google - I switched to mingw64 and the error did not happen in regards to missing .dll. msys64 is most likely missing parts that mingw64 does. A bit weird that the msys guys don't unify this all - it's quite a hassle to go through that if you don't know the problem...