Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cygwin: vagrant ssh, empty command prompt

Tags:

vagrant

cygwin

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."

like image 509
trogne Avatar asked Jul 06 '17 17:07

trogne


2 Answers

I had the same problem with and the solution was to set the VAGRANT_PREFER_SYSTEM_BIN environment variable to get vagrant to use your normal ssh executable.

You can do:

VAGRANT_PREFER_SYSTEM_BIN=1 vagrant ssh

or put this into your .bash_profile:

export VAGRANT_PREFER_SYSTEM_BIN=1

Reference: https://github.com/hashicorp/vagrant/issues/9143#issuecomment-343311263

like image 73
Edu Avatar answered Sep 19 '22 10:09

Edu


I run in the same problem described above. But only on one of three PCs. But as a workaround I am doing:

# save the config to a file
vagrant ssh-config > vagrant-ssh

# run ssh with the file.
ssh -F vagrant-ssh default

From an answer of How to ssh to vagrant without actually running "vagrant ssh"?

In this case I am getting the prompt and what's more important also history cycling and ctrl-c etc. are working properly.

like image 43
Uriziel47 Avatar answered Sep 20 '22 10:09

Uriziel47