hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.28k stars 4.43k forks source link

powershell host is broken after Ctrl+C in `vagrant powershell` #8903

Open DannyMeister opened 7 years ago

DannyMeister commented 7 years ago

When using Ctrl+C to interrupt a command when I'm in vagrant powershell (a long habit for certain things such as stopping a ping command after the first failure when testing network connectivity), both the host and guest shells are broken in a way that I cannot recover without closing my host powershell window. I see a command prompt spaced several lines apart for each machine with a

The remote pipeline has been stopped.

error sandwiched between as seen here:

bizarro_shell1

Both prompts seem to attempt to steal focus from each other if I continue to type. For example, here's the result if i try to type the command exit:

bizarro_shell2

Steps to reproduce

  1. vagrant up a Windows guest on a Windows host
  2. vagrant powershell
  3. run a command/process that will take a bit, such as a ping that will timeout
  4. use Ctrl+C on keyboard to interrupt the command
  5. Enter the twilight zone

Vagrant version

1.9.7

Host OS

Windows 10 v 1703 (Creators Update) build 15063.0

Guest OS

Windows 2016 Standard Edition

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "gusztavvargadr/w16s-sql14d"
  config.vm.box_version = "0.6.0"

  config.vm.provision "shell", inline: <<'SHELL'
    cd c:\vagrant
    .\MachineSetup.ps1
SHELL
end
darkn3rd commented 6 years ago

I have encountered this issue as well with Windows 8.1 host, Vagrant 2.1.2, with Windows 2016 guest.