# capture username and password for smb synced folders # source https://github.com/mitchellh/vagrant/issues/5624 if RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw32/ puts "Due to MinTTY and Cygwin not supporting the no-echo TTY mode" puts "it is necessary to request your account username and password" puts "at this stage in order to correctly setup SMB shared folders." puts print "Enter username: " STDOUT.flush username = STDIN.gets.chomp # 8m is the control code to hide characters print "Enter password: \e[0;8m" STDOUT.flush password = STDIN.gets.chomp # 0m is the control code to reset formatting attributes puts "\e[0m" STDOUT.flush end