cygwin: vagrant ssh, empty command prompt

Viewed 2459

If I vagrant ssh with windows cmd, I get a nice command prompt, like that:

vagrant@homestead:~$ echo foo
vagrant@homestead:~$ foo

But with cygwin and mintty, I have no prompt at all:

echo foo
foo

I see it has to do with "pseudo-tty allocation".

With cygwin and mintty, I can have my prompt with this :

vagrant ssh -- -t -t

How can I change cygwin and mintty so that I don't have to tell the -t ?

About the ssh -t option :

"Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty."

5 Answers

Since vagrant is windows-based, I use ConEmu instead of cygwin's shell (mintty)

choco install conemu via chocolatey and it works

General solution is to teach vagrant to use ssh, compatible with preferred terminal. Like Cygwin ssh+mintty.

Modern Vagrant (v2.1.2) has VAGRANT_PREFER_SYSTEM_BIN=1 by default on Windows.

To troubleshoot issue:

VAGRANT_LOG=info vagrant ssh

In v2.1.2 they broke Cygwin support. See my bug report with hack to lib/vagrant/util/ssh.rb to make it work.

Related