Cygwin: vagrant ssh, blank tip

If I vagrant ssh with cmd windows, I get a nice command line, for example:

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

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

 echo foo foo 

I see that this is due to the "pseudo-tty distribution".

With cygwin and mintty, I can get an invitation with this:

 vagrant ssh -- -t -t 

How can I change cygwin and mintty so that I don't need to specify -t ?

About the ssh -t option:

"Forced distribution of pseudo-tty. This can be used to perform screen-based arbi- trary on a remote machine, which can be very useful, for example, when implementing menu services. Several -t options force tty, even if ssh does not have local tty . "

+5
source share
4 answers

I had the same problem and the solution was to set the environment variable VAGRANT_PREFER_SYSTEM_BIN in order to get a firewall to use your regular ssh executable.

You can do:

VAGRANT_PREFER_SYSTEM_BIN=1 vagrant ssh

or put this in your .bash_profile:

export VAGRANT_PREFER_SYSTEM_BIN=1

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

+5
source

Vagrant is a program that manages a windows virtual machine
https://www.vagrantup.com/intro/index.html

as such, it interacts poorly with the pseudo-tty structure used by cygwin programs. Read for help on similar issues with lots of other windowing programs.
https://github.com/mintty/mintty/issues/56

Mintty is a Cygwin program. He expects an interactive program to work inside him to use the cygwin tty functionality for interactive behavior. Starting the firewall from Bash to Windows CMD, make the CMD terminal-controlled so that Vagrant does not have problems in interactive behavior.

I do not see the need to run Vagrant inside Cygwin

+1
source

I am running the same problem described above. But only on one of the three PCs. But as a workaround, I do:

 # save the config to a file vagrant ssh-config > vagrant-ssh # run ssh with the file. ssh -F vagrant-ssh default 

From the answer How is ssh for vagrants without actually running the "ssh firewall"?

In this case, I get a hint, and more importantly, as well as the cyclical nature of the story and ctrl-c, etc. work fine.

+1
source

Since the firewall is windowed, I use ConEmu instead of a cygwin shell (mintty)

choco install conemu via chocolate and works

0
source

Source: https://habr.com/ru/post/1269573/


All Articles