terraform login doesn't accept copy paste token on Windows 10

Created on 19 Aug 2020  ยท  5Comments  ยท  Source: hashicorp/terraform

Version 0.13, windows 10x64

Expected Behavior

What should have happened?

  • terraform login
  • go through process of creating token on website
  • copy token / verify can paste in other app
  • tf app should accept paste Ctrl-V of token and authenticate the session

Actual Behavior

  • terraform login
  • enter Yes to create token
  • go through process of creating token on website
  • copy token / verify can paste in other app
  • ctrl-V in windows command line terminal results in nothing happening at terraform prompt
  • in fact, i can't even type anything at the prompt to paste/enter the token

Steps to Reproduce

  • terraform login
  • enter YES
  • generate token on website, copy it
  • attempt to paste
  • nothing happens

Additional Context

This is the prompt where it gets hung after I create and attempt to paste a token


Terraform must now open a web browser to the tokens page for app.terraform.io.

If a browser does not open this automatically, open the following URL to proceed:
https://app.terraform.io/app/settings/tokens?source=terraform-login


Generate a token using your browser, and copy-paste it into this prompt.

Terraform will store the token in plain text in the following file
for use by subsequent commands:
C:\Users\dev\AppData\Roaming\terraform.d\credentials.tfrc.json

Token for app.terraform.io:
Enter a value:

bug v0.13 windows working as designed

Most helpful comment

LOL that's it. First time using TF so clearly this was user error. Thanks!!!

All 5 comments

I can't reproduce this problem on Windows 10, either using Powershell or cmd.exe.

  • Could it be a generic problem with copy & paste and your command prompt?
  • Can you copy & paste any other text into the command prompt, without using Terraform?
  • Have you tried using the menu to paste? If you type Alt-Space E P it should work

I've tried a few more times and still get same result. So I can reproduce.

And, before I enter the TF login command I can paste into the terminal. And when I exit the TF login command I can again paste into the terminal. But, while the command is running, I can't keystroke paste or File menu - Edit - Paste into the TF prompt.

Maybe I should try a different terminal for Win10 to use with TF? I'm just using cmd.exe currently. Do I need elevated privileges or anything else I should know before I try to start using TF on windows?

One final thing that may not be clear: when you paste into the password prompt, echo is disabled for security reasons, so it will appear that you are not pasting anything. You need to paste the token from Terraform Cloud, which will display nothing, then hit enter. Terraform will then verify that the token is valid before saving it.

Can you try that and report back please?

LOL that's it. First time using TF so clearly this was user error. Thanks!!!

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rjinski picture rjinski  ยท  3Comments

larstobi picture larstobi  ยท  3Comments

rkulagowski picture rkulagowski  ยท  3Comments

ronnix picture ronnix  ยท  3Comments

zeninfinity picture zeninfinity  ยท  3Comments