Can't paste text at a TFX-CLI console (NPM)

和自甴很熟 提交于 2019-12-02 17:11:27

问题


I'm unable to paste text at CLI prompts when running tfx-cli.

I've just installed Node v8.9.1 LTS. Unfortunately, the tfx-cli install hung the first time through. I pressed Ctrl+C to cancel it, ran it again, and the second time it completed. (In the text that flashed across my screen during the second run, I believe I saw something about 'failed' and 'rollback.')

I don't know whether the initial failure is contributing to my problem.

When I run tfx login, I get this prompt first:

> Service URL:

I can type at this prompt, but I can't paste. Once I type the URL and press Enter I get this:

> Personal access token:

I can neither paste nor type at this prompt (or at least the cursor doesn't advance when I type). The only keys that seem to work here are Enter and Ctrl+C. Pressing Enter without typing anything results in this:

error: Invalid input for Personal access token:

Pressing Enter after typing a few random characters sends no output to the console and simply dumps me back at the C:\> prompt.

How to fix this? How can one determine whether it's a Node problem or a tfx-cli problem? I suspect the latter but I'm not sure.

--EDIT--

Are others able to paste text at these prompts?


回答1:


I tested on my side with Node v8.9.1 LTS installed. Everything works correctly.

Make sure you have activated the command line window before pasting the text.

For Personal access token or password, it's implicit (non-visible) in the command line. The token strings will not show there when pasting the PAT/password. But it works if you enter the correct token.

So, just make sure you activated the cmd window before paste action:

  1. Copy PAT/password (Sometimes you need to try this several times to make sure the strings are copied)
  2. Activate the command line window (click within the window to active it)
  3. Paste the PAT/password (It's implicit, just make sure you pasted the correct token )
  4. Enter

UPDATE:

Seems related to the OS or permission. Whatever, you can try running the cmd as Administrator, then check whether you can copy and paste now.

Besides, you can also try to enable "QuickEdit Mode" for CMD console. ( Right-click on the title-bar of your cmd window. --> [Properties] - Options - check "QuickEdit Mode"

Also try the ways mentioned in this article: How to Enable CTRL+C / Ctrl+V for Pasting in the Windows Command Prompt



来源:https://stackoverflow.com/questions/47233884/cant-paste-text-at-a-tfx-cli-console-npm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!