0

I'm using a Conemu task to ssh into my server. In order to have 256 color for my motd generator support I have put the cygwin-connector conemu-cyg-64.exe in the bin folder of my CygWin installation on both my desktop and my laptop. (https://github.com/Maximus5/cygwin-connector)

On my desktop the following task works perfect:

conemu-cyg-64.exe -cur_console:h0 ssh [email protected]

On my laptop, using the same command and the same setup, I get this error:

Pseudo-terminal will not be allocated because stdin is not a terminal

I tried many things, such as re-installing CygWin completely, changing the openssh version. I tried with version 7.1p1-1 and version 6.9p1-1. Everything I tried gave the same error, except when I use the ssh command with -tt parameter.

conemu-cyg-64.exe -cur_console:h0 ssh -tt [email protected]

But this causes other problems, as tab completion seems to no longer work when using -tt and also arrow give OA OC OB OD as result.

When using a blank connector

conemu-cyg-64.exe -cur_console:h0

without the ssh command:

ssh -V
OpenSSH_7.1p1, OpenSSL 1.0.2e 3 Dec 2015


which ssh
/usr/bin/ssh

Config is exact the same as on my desktop where the first task in the question works perfect. When I open the task 'conemu-cyg-64.exe -cur_console:h0' and then paste 'ssh [email protected]' it works.

Any idea's or tips to troubleshoot this so it works with the ssh in the task are welcome. From Cmd (cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd") on Desktop:

> conemu-cyg-64.exe --verbose ssh [email protected]
{PID:19148} declaring TERM: `xterm-256color` (was: `cygwin`)
{PID:19148} current $HOME is `/cygdrive/c/Users/Willem`
{PID:19148} 0: isatty()=1; pgrp=19148; ttyname()=`/dev/cons0`
{PID:19148} 1: isatty()=1; pgrp=19148; ttyname()=`/dev/cons0` 
{PID:19148} 2: isatty()=1; pgrp=19148; ttyname()=`/dev/cons0`
{PID:19148} calling fork (pgid=19148)
{PID:19148} child pid=23540 pgid=19148 was created (ourpgid=19148)
{PID:19148} PTY was created: `/dev/pty0`; Child PID:23540
{PID:19148} 0: isatty()=1; pgrp=19148; ttyname()=`/dev/cons0`
{PID:19148} 1: isatty()=1; pgrp=19148; ttyname()=`/dev/cons0`
{PID:19148} 2: isatty()=1; pgrp=19148; ttyname()=`/dev/cons0` 
{PID:19148} raising SIGUSR1 in pid=23540
{PID:19148} SIGUSR1 received
{PID:23540} child created (pgid=23540)
{PID:23540} child process wating for SIGUSR1 (pgid=23540)
{PID:23540} SIGUSR1 received
{PID:23540} child process continues after 0 ms (SIGUSR1=1)
{PID:23540} ttyname(1)=`/dev/pty0`
{PID:23540} ttyname(1)=`/dev/pty0`
{PID:23540} 0: isatty()=1; pgrp=23540; ttyname()=`/dev/pty0`
{PID:23540} 1: isatty()=1; pgrp=23540; ttyname()=`/dev/pty0`
{PID:23540} 2: isatty()=1; pgrp=23540; ttyname()=`/dev/pty0`
{PID:23540} raising SIGUSR1 in pid=19148
{PID:23540} shell: `ssh` `[email protected]`
{PID:23540}   dir: `/cygdrive/c/Users/Willem`
Last login: Thu Jan  7 18:56:29 2016 from 78-21-31-4.access.telenet.be

On my desktop: echo $TERM xterm-256color

On laptop:

$ conemu-cyg-64.exe --verbose ssh [email protected]
{PID:13184} declaring TERM: `xterm-256color` (was: `cygwin`)
{PID:13184} current $HOME is `/cygdrive/c/Users/willem/`
{PID:13184} 0: isatty()=1; pgrp=13184; ttyname()=`/dev/cons0`
{PID:13184} 1: isatty()=1; pgrp=13184; ttyname()=`/dev/cons0`
{PID:13184} 2: isatty()=1; pgrp=13184; ttyname()=`/dev/cons0`
{PID:13184} calling fork (pgid=13184)
{PID:13184} child pid=8680 pgid=13184 was created (ourpgid=13184)
{PID:13184} PTY was created: `/dev/pty0`; Child PID:8680
{PID:13184} 0: isatty()=1; pgrp=13184; ttyname()=`/dev/cons0`
{PID:13184} 1: isatty()=1; pgrp=13184; ttyname()=`/dev/cons0`
{PID:13184} 2: isatty()=1; pgrp=13184; ttyname()=`/dev/cons0`
{PID:13184} raising SIGUSR1 in pid=8680
{PID:13184} SIGUSR1 received
{PID:8680} child created (pgid=8680)
{PID:8680} child process wating for SIGUSR1 (pgid=8680)
{PID:8680} SIGUSR1 received
{PID:8680} child process continues after 16 ms (SIGUSR1=1)
{PID:8680} ttyname(1)=`/dev/pty0`
{PID:8680} ttyname(1)=`/dev/pty0`
{PID:8680} 0: isatty()=1; pgrp=8680; ttyname()=`/dev/pty0`
{PID:8680} 1: isatty()=1; pgrp=8680; ttyname()=`/dev/pty0`
{PID:8680} 2: isatty()=1; pgrp=8680; ttyname()=`/dev/pty0`
{PID:8680} raising SIGUSR1 in pid=13184
{PID:8680} shell: `ssh` `[email protected]`
{PID:8680}   dir: `/cygdrive/c/Users/willem`
Pseudo-terminal will not be allocated because stdin is not a terminal.
pwd
/home/user
echo $TERM

pwd
/home/user

/usr/bin/sh -c "set" on laptop:

$ conemu-cyg-64.exe --verbose --shlvl /usr/bin/sh -c "set"
{PID:5788} declaring TERM: `xterm-256color` (was: `cygwin`)
{PID:5788} current $HOME is `/cygdrive/c/Users/willem/`
{PID:5788} 0: isatty()=1; pgrp=5788; ttyname()=`/dev/cons0`
{PID:5788} 1: isatty()=1; pgrp=5788; ttyname()=`/dev/cons0`
{PID:5788} 2: isatty()=1; pgrp=5788; ttyname()=`/dev/cons0`
{PID:5788} calling fork (pgid=5788)
{PID:5788} child pid=19116 pgid=5788 was created (ourpgid=5788)
{PID:5788} PTY was created: `/dev/pty0`; Child PID:19116
{PID:5788} 0: isatty()=1; pgrp=5788; ttyname()=`/dev/cons0`
{PID:5788} 1: isatty()=1; pgrp=5788; ttyname()=`/dev/cons0`
{PID:5788} 2: isatty()=1; pgrp=5788; ttyname()=`/dev/cons0`
{PID:5788} raising SIGUSR1 in pid=19116
{PID:19116} child created (pgid=19116)
{PID:19116} child process wating for SIGUSR1 (pgid=19116)
{PID:19116} SIGUSR1 received
{PID:19116} child process continues after 15 ms (SIGUSR1=1)
{PID:19116} ttyname(1)=`/dev/pty0`
{PID:19116} ttyname(1)=`/dev/pty0`
{PID:19116} 0: isatty()=1; pgrp=19116; ttyname()=`/dev/pty0`
{PID:19116} 1: isatty()=1; pgrp=19116; ttyname()=`/dev/pty0`
{PID:19116} 2: isatty()=1; pgrp=19116; ttyname()=`/dev/pty0`
{PID:19116} raising SIGUSR1 in pid=5788
{PID:19116} shell: `/usr/bin/sh` `-c` `set`
{PID:19116}   dir: `/cygdrive/c/Users/willem`
{PID:5788} SIGUSR1 received
ALLUSERSPROFILE='C:\ProgramData'
ANSICON='118x4000 (118x28)'
ANSICON_DEF=7
APPDATA='C:\Users\willem\AppData\Roaming'
BASH=/usr/bin/sh
BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_EXECUTION_STRING=set
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="3" [2]="42" [3]="4" [4]="release" [5]="x86_64-unknown-cygwin")
BASH_VERSION='4.3.42(4)-release'
COMMONPROGRAMFILES='C:\Program Files\Common Files'
COMPUTERNAME=NBDIG50009
COMSPEC='C:\Windows\system32\cmd.exe'
ChocolateyBinRoot='\bin'
ChocolateyInstall='C:\ProgramData\chocolatey'
CommonProgramW6432='C:\Program Files\Common Files'
ConEmuANSI=ON
ConEmuAnsiLog=
ConEmuArgs=
ConEmuBackHWND=0x000D1506
ConEmuBaseDir='C:\Users\willem\Dropbox\Utilities\ConEmu\ConEmu'
ConEmuBuild=151224
ConEmuConfig=
ConEmuDir='C:\Users\willem\Dropbox\Utilities\ConEmu'
ConEmuDrawHWND=0x000A0C8C
ConEmuDrive=C:
ConEmuHWND=0x0040183C
ConEmuHooks=Enabled
ConEmuIsAdmin=ADMIN
ConEmuPID=14444
ConEmuPrompt0='$E[32m$E]9;8;"USERNAME"$E\@$E]9;8;"COMPUTERNAME"$E\$S'
ConEmuPrompt1='$E[32m$E]9;8;"USERNAME"$E\@$E]9;8;"COMPUTERNAME"$E\$S$E[92m$P$E[90m'
ConEmuPrompt2='$_$E[90m$$'
ConEmuPrompt3='$E[m$S'
ConEmuServerPID=12516
ConEmuWorkDir='C:\Users\willem'
ConEmuWorkDrive=C:
DEFLOGDIR='C:\ProgramData\McAfee\DesktopProtection'
DIRSTACK=()
EUID=1077902
FP_NO_HOST_CHECK=NO
GROUPS=()
HOME=/cygdrive/c/Users/willem/
HOMEDRIVE=H:
HOMEPATH='\'
HOMESHARE='\\userdrive\home'
HOSTNAME=NBDIG50009
HOSTTYPE=x86_64
IFS='
'
LOCALAPPDATA='C:\Users\willem\AppData\Local'
LOGONSERVER='\\DC01'
MACHTYPE=x86_64-unknown-cygwin
NUMBER_OF_PROCESSORS=4
OPTERR=1
OPTIND=1
OS=Windows_NT
OSTYPE=cygwin
PATH='/cygdrive/c/Users/willem/Dropbox/Utilities/ConEmu/ConEmu/Scripts:/cygdrive/c/Users/willem/Dropbox/Utilities/ConEmu:/cygdrive/c/Users/willem/Dropbox/Utilities/ConEmu/ConEmu:/cygdrive/c/Perl64/site/bin:/cygdrive/c/Perl64/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/ProgramData/chocolatey/bin:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SDKs/TypeScript/1.0:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files (x86)/Git/cmd:/cygdrive/c/Program Files (x86)/Git/bin:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/110/Tools/Binn/ManagementStudio:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/cygdrive/c/Program Files/TortoiseHg:/cygdrive/c/Program Files/SourceGear/Common/DiffMerge:/cygdrive/c/Program Files (x86)/Skype/Phone:/usr/bin:/cygdrive/c/Users/willem/AppData/Local/atom/bin:/cygdrive/c/Users/willem/AppData/Local/atom/bin:/cygdrive/c/tools/cmder:/cygdrive/c/Program Files/Boot2Docker for Windows'
PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
POSIXLY_CORRECT=y
PPID=5788
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER='Intel64 Family 6 Model 60 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3c03
PROGRAMFILES='C:\Program Files'
PROMPT='$E[32m$E]9;8;"USERNAME"$E\@$E]9;8;"COMPUTERNAME"$E\$S$E[92m$P$E[90m$_$E[90m$$$E[m$S'
PS4='+ '
PSModulePath='C:\Users\willem\Documents\WindowsPowerShell\Modules'
PUBLIC='C:\Users\Public'
PWD=/cygdrive/c/Users/willem
ProgramData='C:\ProgramData'
ProgramW6432='C:\Program Files'
SHELL=/bin/bash
SHELLOPTS=braceexpand:hashall:interactive-comments:posix
SHLVL=2
SYSTEMDRIVE=C:
SYSTEMROOT='C:\Windows'
TEMP=/cygdrive/c/Users/willem/AppData/Local/Temp
TERM=xterm-256color
TMP=/cygdrive/c/Users/willem/AppData/Local/Temp
UID=1077902
USERDNSDOMAIN=DOMAIN
USERDOMAIN=DOMAIN
USERDOMAIN_ROAMINGPROFILE=DOMAIN
USERNAME=willem
USERPROFILE='C:\Users\willem'
VBOX_MSI_INSTALL_PATH='C:\Program Files\Oracle\VirtualBox\'
VS120COMNTOOLS='C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\'
VSEDEFLOGDIR='C:\ProgramData\McAfee\DesktopProtection'
WINDIR='C:\Windows'
WIX='C:\Program Files (x86)\WiX Toolset v4.0\'
_=/usr/bin/sh
chocolatey_bin_root='\bin'
windows_tracing_flags=3
windows_tracing_logfile='C:\BVTBin\Tests\installpackage\csilogfile.log'

{PID:5788} read(3) failed (5): Input/output error

{PID:5788} pty_fd set to -1

{PID:5788} pid=19116 was terminated, exitcode=0
{PID:5788} Stopping our threads

{PID:5788} normal exit from main

Your last suggestion set me in the right direction. Process Explorer shows that ssh.exe in C:\Program Files (x86)\Git\bin is used

Image of process explorer showing ssh.exe in Git

As Maximus suggests in his answer using /usr/bin/ssh in my tasks solves the problem!

1 Answer 1

0

Rather strange. First thing you shall check - is TERM variable. For simplicity, you may ignore -cur_console:h0 and run tests from bare cmd.exe prompt started in ConEmu.

Try to run on both PCs and compare their output.

conemu-cyg-64.exe --verbose ssh [email protected]

Try to check environment variables set for ssh without profile, run sh set for that on both PCs and compare output.

conemu-cyg-32.exe --verbose --shlvl /usr/bin/sh -c "set"

At last, you must be sure that ssh is started from proper location. You may even run /usr/bin/ssh ... specially for that. Check it with ProcessExplorer.

2
  • Followed first set of your suggestions. I'll continue tomorrow.
    – willemdh
    Jan 7, 2016 at 23:01
  • Getting close. Process Explorer put me in the right direction. Using /usr/bin/ssh in the task works!
    – willemdh
    Jan 8, 2016 at 11:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .